#include <bits/stdc++.h>
using namespace std;
int a[50][50];
int ans[50];
int main() {
  int n, per = 1, c = 0, x = 0, max = 0, j = 1;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      cin >> a[i][j];
      if (a[i][j] > max) {
        max = a[i][j];
      }
    }
    ans[i] = max;
    max = 0;
  }
  x = 0;
  cout << endl;
  for (int q = 1; q <= n; q++) {
    if (ans[q] == n - 1 && x == 0) {
      cout << ans[q] + 1 << " ";
      x++;
    } else {
      cout << ans[q] << " ";
    }
  }
  return 0;
}
