#include <bits/stdc++.h>
using namespace std;
int a[55][55], ans[55];
bool mark[55];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int maxn = 0;
    int tims = 0;
    for (int j = 1; j <= n; j++) {
      scanf("%d", &a[i][j]);
    }
    ans[i] = maxn;
  }
  memset(mark, true, sizeof(mark));
  memset(ans, -1, sizeof(ans));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; i <= n; j++) {
      if (ans[j] != -1) continue;
      bool key = true;
      for (int l = 1; l <= n; l++) {
        if (mark[l] == false || l == j) continue;
        if (a[j][l] > i) key = false;
      }
      if (key) {
        ans[j] = i;
        mark[j] = false;
        break;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d", ans[i]);
    if (i == n)
      printf("\n");
    else
      printf(" ");
  }
}
