#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> mx(n, 0);
  for (int((y)) = (0); ((y)) < ((n)); ((y))++)
    for (int((x)) = (0); ((x)) < ((n)); ((x))++) {
      int a;
      cin >> a;
      mx[y] = max(a, mx[y]);
    }
  int maxTaken = 0;
  for (int((y)) = (0); ((y)) < ((n)); ((y))++) {
    int ans = mx[y];
    if (mx[y] == n - 1) ans += maxTaken, maxTaken = 1;
    cout << ans << " ";
  }
}
