#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll power(ll a, ll b) {
  ll r = 1;
  while (b) {
    if (b & 1) {
      r = r * a;
    }
    b >>= 1;
    a = a * a;
  }
  return r;
}
int main() {
  int n;
  cin >> n;
  vector<vector<int>> a(n, vector<int>(n));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    cout << a[i][i] << ' ';
  }
  cout << endl;
}
