#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define ertunt return
#define rall(x) x.rbegin(),x.rend()
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
ll n;
cin >> n;
vector<vector<ll>>a(n);
for(ll i = 0; i < n; i++){
for(ll j = 0; j < n-i; j++){
ll x;
cin >> x;
a[i].pb(x);
}
}
ll l = 0;
for(; l+1 < n; l++){
if(a[l][n-l-1] != a[l+1][n-(l+1)-1]) break;
}
ll r = n-l-1;
while(r-1 >= 0 and a[l][r] == a[l][r-1]) r--;
cout << l+1 << ' ';
for(ll i = l+1; i <= r; i++){
if(a[l][i] == a[l][i-1]+1){
cout << i+1 << ' ';
continue;
}
if(i+1 < n and r-(i+1) >= 0 and a[i][r-i] == a[i+1][r-(i+1)]+1){
cout << i+1 << ' ';
continue;
}
if(l+1 < n and i-1 >= l and a[l+1][(i-1)-(l+1)] != a[l+1][i-(l+1)]) continue;
if(i+1 < n and r-1 >= l and a[i+1][(r-1)-(i+1)] != a[i][(r-1)-i]) continue;
cout << i+1 << ' ';
}
}