Program masof;
var ar: array of integer;
i, j, temp, N: integer;
begin
readln(N);
setlength(ar, N+1);
for i:=1 to N do begin readln(ar[i]); end;
for i:=1 to N do begin
temp:=0;
for j:=1 to N do begin if ar[j]=ar[i] then inc(temp); end;
if temp>1 then write(ar[i], ' ');
end;
end.