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