output_description: For each input case, you have to print the height of the student in the class
  whose both hands are up. If there is no such student, then print 0 for that
  case.
input_description: The input will consist of several cases. the first line of each case will be
  n(0 < n < 100), the number of rows and columns in the class. It will then be
  followed by a n-by-n matrix, each row of the matrix appearing on a single
  line. Note that the elements of the matrix may not be necessarily distinct.
  The input will be terminated by the case n = 0.
attempt: while True:
      n = int(input())
      if not n:
          break
      print(max(min(map(int, input().split())) for i in range(n)))
  
problem_description: Advanced Algorithm Class
  
  In the advanced algorithm class, n2 students sit in n rows and n columns. One
  day, a professor who teaches this subject comes into the class, asks the
  shortest student in each row to lift up his left hand, and the tallest student
  in each column to lift up his right hand. What is the height of the student
  whose both hands are up ? The student will become a target for professor’s
  questions.
  
  Given the size of the class, and the height of the students in the class, you
  have to print the height of the student who has both his hands up in the
  class.
samples: [{"input": "1 2 3\n    4 5 6\n    7 8 9\n    3\n    1 2 3\n    7 8 9\n    4 5 6\n    0", "output": "7"}]