program BeiDanCi;
var
a:array[1..1000] of string;
i,j,n:integer;
temp:string;
begin
assign(input,'letter.in');
reset(input);
assign(output,'letter.out');
rewrite(output);
readln(n);
for i:=1 to n do
readln(a[i]);
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
temp:=a[i];
a[i]:=a[j];
a[j]:=temp
end;
for i:=1 to n do
writeln(a[i]);
close(input);
close(output)
end.