#include <iostream>
using namespace std;
int main(){
int n,minx,minl,i,j,a[100][100];
//Citire matrice
cin >> n;
for(i=0;i<n;i++){
for(j=0;j<n;j++){
cin >> a[i][j];
}
}
//Determinare minim
minl=0;
minx=a[0][0]
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(a[i][j] < minx){
minx=a[i][j];
minl=i;
}
}
}
//Afisare rezultat
cout << minx << " " << minl;
}