program letter;
var i,n:word;
a:array[1..100]of string;
procedure sort(s,t:word);
var i,j:word; x,w:string;
begin
i:=s; j:=t; x:=a[(i+j)div 2];
repeat
while a[i]<x do inc(i); while a[j]>x do dec(j);
if i<=j then
begin
w:=a[i]; a[i]:=a[j]; a[j]:=w;
inc(i); dec(j);
end;
until i>j;
if s<j then sort(s,j);
if i<t then sort(i,t);
end;
begin
assign(input,'letter.in'); reset(input);
assign(output,'letter.out'); rewrite(output);
readln(n);
for i:=1 to n do readln(a[i]);
sort(1,n);
for i:=1 to n do writeln(a[i]);
close(input); close(output);
end.