#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[55][55];
  int b[55], c[55];
  while (cin >> n) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) scanf("%d", &a[i][j]);
    for (int i = 0; i < n; i++) {
      memset(c, 0, sizeof(c));
      int x = 0;
      for (int j = 0; j < n; j++) {
        if (a[i][j] == 0) continue;
        c[a[i][j]]++;
        if (c[a[i][j]] > c[x]) x = a[i][j];
      }
      if (c[1] == c[n - 1])
        b[i] = n - 1;
      else
        b[i] = x;
    }
    bool t = true;
    for (int i = 0; i < n - 1; i++)
      if (b[i] == n - 1 && t) {
        cout << b[i] + 1 << " ";
        t = false;
      } else
        cout << b[i] << " ";
    cout << b[n - 1] << endl;
  }
  return 0;
}
