var a:array[1..10]of string;answer:ansistring;
n,i:longint;
procedure qsort(s,t:longint);
var i,j:longint; q,m:string;
begin
i:=s; j:=t; m:=a[(s+t)div 2];
repeat
while a[i]<m do inc(i);
while a[j]>m do dec(j);
if i<=j then
begin
q:=a[i]; a[i]:=a[j]; a[j]:=q; inc(i); dec(j); end;
until i>j;
if s<j then qsort(s,j);
if i<t then qsort(i,t);
end;
begin
assign(input,'substring.in');
assign(output,'substring.out');
reset(input);
rewrite(output);
answer:='';
readln(n);
for i:=1 to n do
readln(a[i]);
qsort(1,n);
for i:=1 to n do
answer:=answer+a[i];
write(answer);
close(input);
close(output);
end.