You are given a two-dimensional array of size . Find the maximum element in each line, and find the minimum among the maximum elements.
The first line contains two integers and — the number of rows and columns. Then lines of integers are given — the elements of array.
All numbers do not exceed by absolute value.
Print one number — the answer to the problem.