var
n:integer;
s:array[1..8]of ansistring;
g:array[1..8]of integer;
ans:ansistring;
procedure mj(w:longint;st:ansistring);
var
i:longint;
a:ansistring;
begin
if w<>n then
for i:=1 to n do
if g[i]=0 then
begin
g[i]:=1;
mj(w+1,st+s[i]);
g[i]:=0;
end;
if w=n then
if (ans='')or(ans>st) then ans:=st;
end;
begin
assign(input,'substring.in');
assign(output,'substring.out');
reset(input);
rewrite(output);
readln(n);
for n:=1 to n do
readln(s[n]);
mj(0,'');
writeln(ans);
close(input);close(output);
end.