Program z1;
var a:array[1..100] of integer;
i,j,n:byte;
begin
readln(n);
randomize;
for i:=1 to n do begin
a[i]:=random(900)+100;
end;
for j:=0 to 9 do begin
for i:=1 to n do begin
if ((a[i] div 10) mod 10)=j then begin
write(a[i],' ')
end
end
end;
readln
end.