#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
int n,o=0,answer[101];
int q[101][101];
int number[101]={0};
bool used[101];
int main()
{
freopen ("curriculum.in","r",stdin);
freopen ("curriculum.out","w",stdout);
cin>>n;
for (int i=1;i<=n;i++)
{
int a;
cin>>a;
for (int j=0;j<a;j++)
{
int b;
cin>>b;
number[i]++;
q[i][number[i]]=b;
}
used[i]=true;
}
int a;
a=n;
while (a>0)
{
int b;
for (int i=1;i<=n;i++)
{
if (number[i]==0&&used[i])
{
b=i;
break;
}
}
for (int i=1;i<=n;i++)
{
if (i==b)
continue;
for (int j=1;j<=n;j++)
{
if (q[i][j]==b)
{
q[i][j]=0;
number[i]--;
}
}
}
o++;
answer[o]=b;
a--;
used[b]=0;
}
for (int i=1;i<=n;i++)
cout<<answer[i]<<' ';
return 0;
}