#include<bits/stdc++.h>
using namespace std ;
const int N = 1005 ;
int n , arr[N][N] ;
vector<int> path ;
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) ;
cin >> n ;
for(int i=1 ; i<n ; i++){
for(int j=0 ; j<i ; j++){
int p ; cin >> p ;
if(j<=(i-1)/2) arr[i][p]=arr[p][i]=1 ;
}
}
path.push_back(0) ; path.push_back(1) ;
for(int i=2 ; i<n ; i++){
if(arr[i][path[0]]) reverse(path.begin(),path.end()) ;
if(arr[i][path.back()]){
path.push_back(i) ;
continue ;
}
for(int j=1 ; j<path.size() ; j++){
if(arr[i][path[j-1]] && arr[i][path[j]]){
vector<int> temp ;
for(int l=0 ; l<j ; l++) temp.push_back(path[l]) ;
temp.push_back(i) ;
for(int l=j ; l<path.size() ; l++) temp.push_back(path[l]) ;
path = temp ;
break ;
}
}
}
for(int i:path) cout << i << ' ' ;
cout << '\n' ;
return 0 ;
}