Var a: array[1..100] of string;
n,i: longint;
/////
procedure sort(l,r: longint);
var
i,j: longint;
x,y: string;
begin
i:=l;
j:=r;
x:= a[(l+r) div 2];
repeat
while a[i] inc(i);
while x dec(j);
if not(i>j) then
begin
y:=a[i];
a[i]:=a[j];
a[j]:=y;
inc(i);
j:=j-1;
end;
until i>j;
if l sort(l,j);
if i sort(i,r);
end;
Begin
Readln(n);
For i:= 1 to n do Readln(a[i]);
sort(1,n);
For i:= n downto 1 do write(a[i]);
end.