var
n,m,i,j,k,y:longint;
v:array[0..10000]of boolean;
now:boolean;
g:array[0..200,0..200]of boolean;
ru:array[0..10000]of longint;
begin
assign(input,'curriculm.in'); reset(input);
assign(output,'curriculm.out'); rewrite(output);
readln(n);
for i:=1 to n do
begin
read(m);
for j:=1 to m do
begin
read(y);
g[y,i]:=true;
inc(ru[i]);
end;
end;
for i:=1 to n do v[i]:=true;
for j:=1 to n do
begin
now:=false;
for i:=1 to n do
if (ru[i]=0)and(v[i]) then
begin
write(i,' ');
v[i]:=false;
for k:=1 to n do
if g[i,k] then
begin
g[i,k]:=false;
dec(ru[k]);
end;
now:=true;
break;
end;
if not now then
begin
writeln('no');
close(input);
close(output);
halt;
end;
end;
writeln;
close(input);
close(output);
end.