import java.util.Scanner;
public class Main {
public static void quickSort(int[] list, int left, int right){
if (left<right){
int mid = positsion(list, left, right);
quickSort(list, left, mid-1);
quickSort(list, mid+1, right);
}
}
public static int positsion(int[] list, int left, int right){
int pivot = left;
int index = pivot+1;
for (int i=index;i<=right;i++){
if (list[pivot]>list[i]){
int temp = list[index];
list[index] = list[i];
list[i] = temp;
index++;
}
}
int temp = list[pivot];
list[pivot] = list[index-1];
list[index-1] = temp;
return index-1;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[][] list = new int[N][N];
for (int i=0;i<N;i++){
for (int j=0;j<N;j++){
if (i<j){
list[i][j] = sc.nextInt();
list[j][i] = list[i][j];
}
}
}
int[] secondMax = new int[N];
for (int i=0;i<N;i++){
quickSort(list[i], 0, N-1);
}
for (int i=0;i<N;i++){
secondMax[i] = list[i][N-2];
}
quickSort(secondMax, 0, N-1);
System.out.println(1);
System.out.println(secondMax[N-1]);
}
}