{
TASK:ABC
LANG:PASCAL
}
program abecele;

    const MAX = 255;

    var
       pries      : array[0..MAX, 0..MAX] of Boolean;
       yra_sarase : array[0..MAX] of Boolean;
       kiek_pries : array[0..MAX] of Integer;
       raidziu_sk : Integer;

       abc        : String;

procedure Skaityti;
var
   f       : Text;
   m_ilgis : Integer;
   i, j, N : Integer;
   z1, z2  : String;
begin
    Assign(f, 'ABC.DAT'); Reset(f);
    z1 := ''; z2 := '';
    Readln(f, N);
    for j := 1 to N do begin
        Readln(f, z1);
        for i := 1 to Length(z1) do
            if (not yra_sarase[Ord(z1[i])]) then begin
                yra_sarase[Ord(z1[i])] := True;
                Inc(raidziu_sk);
            end;
        if (Length(z1) < Length(z2)) then m_ilgis := Length(z1)
            else m_ilgis := Length(z2);
        i  := 1;
        while (i <= m_ilgis) and (z1[i] = z2[i]) do Inc(i);
        if (i <= m_ilgis) then
            if (not pries[Ord(z2[i])][Ord(z1[i])]) then begin
                pries[Ord(z2[i])][Ord(z1[i])] := True;
                Inc(kiek_pries[Ord(z1[i])]);
            end;
        z2 := z1;
    end;
    Close(f);
end;

procedure Rasyti;
var
   f : Text;
begin
    Assign(f, 'ABC.REZ'); Rewrite(f);
    Write(f, abc);
    Close(f);
end;

    var
       i, j, k    : Integer;

begin
    Skaityti;

    abc := '';
    for i := 1 to raidziu_sk do begin
        j := 0;
        while ((not yra_sarase[j]) or (kiek_pries[j] > 0)) do Inc(j);
        abc := abc + Chr(j);
        yra_sarase[j] := False;
        for k := 0 to MAX do
            if (pries[j][k]) then Dec(kiek_pries[k]);
    end;

    Rasyti;
end.