#include <bits/stdc++.h>
using namespace std;
const int maxn = 50 + 10;
int n;
int a[maxn][maxn];
int pos[maxn];
void nhap() {
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) cin >> a[i][j];
}
void xuat() {
  for (int i = 1; i <= n; i++) cout << pos[i] << " ";
}
void xuli(int x) {
  for (int i = 1; i <= n; i++)
    if (pos[i] == 0) {
      int u = i, d = i, l = i, r = i;
      while (u > 0 && a[u][i] <= x) u--;
      if (u != 0) continue;
      while (l > 0 && a[i][l] <= x) l--;
      if (l != 0) continue;
      while (d <= n && a[d][i] <= x) d++;
      if (d != n + 1) continue;
      while (r <= n && a[i][r] <= x) r++;
      if (r != n + 1) continue;
      pos[i] = x;
      return;
    }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  nhap();
  for (int i = 1; i <= n; i++) xuli(i);
  xuat();
  return 0;
}
