#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int a[n+1][n+1]; for(int i =1;i<=n;i++){ for(int j =1;j<=n;j++){ cin >> a[i][j]; } } for(int i =1;i<=n;i++){ for(int j =1;j<=n;j++){ int flag =1; for(int k =1;k<=n;k++){ if(a[i][j]<a[i][k]){ flag = 0; } } for(int k =1;k<=n;k++){ if(a[i][j]>a[k][j]){ flag = 0; } } if(flag == 1){ cout << a[i][j] << " "; } } } }