vars:array[1..10000] of longint;f:array[1..10000,1..10000] of boolean;a,d:array[1..10000] of boolean;n:longint;
procedurexxoo(x:longint);vari:longint;c:boolean;
begina[x]:=false;c:=true;for i:=1to n dobeginif (f[i,x])and(a[i]) thenbeginxxoo(i);s[x]:=s[x]+s[i];if s[i]>n div2thenc:=false;end;end;if n-s[x]>n div2thenc:=false;if c then d[x]:=true;
end;
vari,x,y:longint;c:boolean;
beginreadln(n);for i:=1to n-1dobeginreadln(x,y);f[x,y]:=true;f[y,x]:=true;end;fillchar(a,sizeof(a),true);for i:=1to n doinc(s[i]);xxoo(1);for i:=1to n doif d[i] then writeln(i);
end.