Program gt;
var a,b:array[1..100]of integer;
j,i,h:integer;
begin
for i:=1 to 10 do
begin
read(a[i]);
end;
for i:=1 to 10 do
begin
h:=0;
for j:=1 to 10 do
begin
if(a[i]=a[j])then h:=h+1;
end;
b[i]:=h;
end;
for i:=1 to 10 do
begin
if(b[i]>1)then begin
for j:=1 to b[i] do
begin
write(a[j],' ');
endl
end;
end.