#include <bits/stdc++.h>
using namespace std;
int const MN = 111;
int n, a[MN][MN], p[MN], f;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      p[i] = max(p[i], a[i][j]);
      p[j] = max(p[j], a[i][j]);
    }
  }
  for (int i = 0; i < n; i++)
    if (p[i] == n - 1 && !f) {
      cout << n << ' ';
      f = 1;
    } else
      cout << p[i] << ' ';
}
