#include<bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const int mininf = 1e9 + 7;
#define int long long
#define pb emplace_back
inline int read(){int x=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}return x*f;}
inline void write(int x){if(x<0){x=~(x-1);putchar('-');}if(x>9)write(x/10);putchar(x%10+'0');}
#define put() putchar(' ')
#define endl puts("")
const int MAX = 55;
int a[MAX][MAX];
void solve(){
int n = read();
int ans = 0;
for(int i = 1; i <= n; i++){
int cnt = = inf;
for(int j = 1; j <= n; j++){
a[i][j] = read();
cnt = min(cnt, a[i][j]);
}
ans = max(ans, cnt);
}
write(cnt), endl;
}
signed main(){
int t = 1;
while(t--) solve();
return 0;
}