#include<bits/stdc++.h>
using namespace std;
int n,deg[109],graph[109][109],k;
void tops(){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(deg[j]==0){
cout<<j<<' ';
deg[j]=9999999;
for(int k=1;k<=n;k++){
if(graph[j][k]==1){
deg[k]--;
}
}
break;
}
}
}
}
int main(){
cin>>n;
for(int i=1;i<=n;i++){
while(k!=0){
cin>>k;
graph[i][k]=1;
deg[k]++;
}
}
tops();
return 0;
}