Problem: Bob has a permutation of integers from 1 to n. Denote this permutation as p. The i-th element of p will be denoted as pi. For all pairs of distinct integers i, j between 1 and n, he wrote the number ai, j = min(pi, pj). He writes ai, i = 0 for all integer i from 1 to n.

Bob gave you all the values of ai, j that he wrote down. Your job is to reconstruct any permutation that could have generated these values. The input will be formed so that it is guaranteed that there is at least one solution that is consistent with the information given.

Input

The first line of the input will contain a single integer n (2 ≤ n ≤ 50).

The next n lines will contain the values of ai, j. The j-th number on the i-th line will represent ai, j. The i-th number on the i-th line will be 0. It's guaranteed that ai, j = aj, i and there is at least one solution consistent with the information given.

Output

Print n space separated integers, which represents a permutation that could have generated these values. If there are multiple possible solutions, print any of them.

Examples

Input

2
0 1
1 0


Output

2 1


Input

5
0 2 2 1 2
2 0 4 1 3
2 4 0 1 3
1 1 1 0 1
2 3 3 1 0


Output

2 5 4 1 3

Note

In the first case, the answer can be {1, 2} or {2, 1}.

In the second case, another possible answer is {2, 4, 5, 1, 3}.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
const double PI = acos(-1.0);
double tick() {
  static clock_t oldtick;
  clock_t newtick = clock();
  double diff = 1.0 * (newtick - oldtick) / CLOCKS_PER_SEC;
  oldtick = newtick;
  return diff;
}
template <typename T>
T mod(T a, T b) {
  return (a < b ? a : a % b);
}
long long mulmod(long long a, long long b, long long m) {
  long long q = (long long)(((long double)a * (long double)b) / (long double)m);
  long long r = a * b - q * m;
  if (r > m) r %= m;
  if (r < 0) r += m;
  return r;
}
template <typename T>
T expo(T e, T n) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = x * p;
    p = p * p;
    n >>= 1;
  }
  return x;
}
template <typename T>
T power(T e, T n, T m) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = mod(x * p, m);
    p = mod(p * p, m);
    n >>= 1;
  }
  return x;
}
template <typename T>
T powerL(T e, T n, T m) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = mulmod(x, p, m);
    p = mulmod(p, p, m);
    n >>= 1;
  }
  return x;
}
template <typename T>
T InverseEuler(T a, T m) {
  return (a == 1 ? 1 : power(a, m - 2, m));
}
template <typename T>
T gcd(T a, T b) {
  return __gcd(a, b);
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
int a[55][55];
int ans[55];
bool v[55][55];
int main() {
  int n;
  scanf("%d", &n);
  for (__typeof(1) i = 1; i <= n; ++i) {
    for (__typeof(1) j = 1; j <= n; ++j) {
      scanf("%d", &a[i][j]);
      v[i][j] = false;
    }
  }
  int first = 1, pos;
  int reqd = n - 1;
  for (__typeof(1) m = 1; m <= n - 1; ++m) {
    pos = -1;
    for (__typeof(1) i = 1; i <= n; ++i) {
      int count = 0;
      for (__typeof(1) j = 1; j <= n; ++j) {
        if (a[i][j] == first && v[i][j] == false) {
          count++;
        }
      }
      if (count == reqd) {
        pos = i;
        ans[pos] = first;
        first++;
        reqd--;
        for (__typeof(1) k = 1; k <= n; ++k) {
          v[pos][k] = true;
        }
        for (__typeof(1) k = 1; k <= n; ++k) {
          v[k][pos] = true;
        }
        break;
      }
    }
    if (pos == -1) break;
  }
  for (__typeof(1) i = 1; i <= n; ++i) {
    if (ans[i] == 0) {
      ans[i] = first;
      first++;
    }
  }
  for (__typeof(1) i = 1; i <= n; ++i) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}