#include <bits/stdc++.h>
using namespace std;
bool compare(int a, int b) { return a < b; }
bool compare1(int a, int b) { return a > b; }
int n, a[100][100], ans[100];
int solve(int i) { return 0; }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cin >> a[i][j];
    }
    for (int j = i + 1; j < n; ++j) {
      ans[i] = max(ans[i], a[i][j]);
      ans[j] = max(a[i][j], ans[j]);
    }
  }
  int flag = 0;
  for (int i = 0; i < n; ++i) {
    if (ans[i] == n - 1 && flag == 0) {
      cout << ans[i];
      flag = 1;
    } else if (ans[i] == n - 1 && flag == 1) {
      cout << ans[i] + 1;
    } else
      cout << ans[i];
    if (i != n - 1) cout << " ";
  }
  cout << endl;
  return 0;
}
