#include <bits/stdc++.h>
using namespace std;
int n;
int m[53][53] = {0};
int v[53] = {0};
int zn[53] = {0};
int use[53] = {0};
int func(int p) {
  while (use[p]) {
    p++;
  }
  use[p] = 1;
  return p;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> m[i][j];
  for (int i = 0; i < n; i++) {
    int maxi = -1;
    for (int j = 0; j < n; j++) maxi = max(maxi, m[i][j]);
    v[i] = maxi;
    zn[i] = 1;
  }
  int co = 0;
  while (1) {
    int change = 0;
    if (co >= n) break;
    for (int i = 0; i < n; i++)
      for (int j = i + 1; j < n; j++) {
        if (min(v[j], v[i]) != m[i][j] && zn[i] == 2 && zn[j] != 2) {
          change = 1;
          v[j] = func(m[i][j]);
          zn[j] = 2;
          co++;
        }
        if (m[i][j] < v[i] && zn[i] == 1 && zn[j] != 2) {
          change = 1;
          zn[j] = 2;
          v[j] = func(m[i][j]);
          co++;
        }
      }
    if (co >= n) break;
    if (change == 0) {
      for (int i = 0; i < n; i++) {
        if (zn[i] == 1) {
          co++;
          zn[i] = 2;
          v[i] = func(v[i]);
          break;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) cout << v[i] << " ";
}
