그리디 (96)
n, m = map(int, input().split())
arr = []
for _ in range(n):
temp = list(map(int, input().split()))
arr.append(min(temp))
print(max(arr))
n, m = map(int, input().split())
result = 0
for _ in range(n):
temp = list(map(int, input().split()))
miny = min(temp)
result = max(result, miny)
print(result)