
var
    n, i,j,k : integer;
    trade : array[1..4000] of string;
    
    chars : array[1..26] of char;
    charsN : byte;
    
    a : byte;
    pom, ret : string;

procedure getChars();
var
    i,j : integer;
begin
    charsN := 0;
    for j:= 1 to 26 do
    begin
	i:= 1;
	while (pos(chr(a-1+j),trade[i])<=0 )and(i<=n) do
	    inc(i);
	if ( i <= n) then 
	begin
	    inc(charsN);
	    chars[charsN] := chr(a-1+j);
	end;
    end;
    
end;


function find(s:string): boolean;
var
    i,j : integer;
    ret : boolean;
begin
    ret:=true;
    
    for i:=1 to n do
    begin
	if pos(s, trade[i])<=0 then ret:= false;
    end;

    find := ret;
end;







function makeall(s:string; ch:char):string;
var
    i,j : integer;
    ret, pom : string;
begin
    if find(s+ch) then
    begin
	ret := s+ch;
	for i:= 1 to charsn do
	begin
	    pom := makeall(s+ch,chars[i]);
	    if length(pom)>length(ret) then ret:=pom;
	end;
	makeall:=ret;
    end
    else
	makeall := s;
end;





Begin
    a := ord('a');
    
    while true do
    begin
	charsN := 0;
        readln(n);        
        if n=0 then break;
        
	for i:= 1 to n do
	begin
	    readln(trade[i]);
	end;
	
	getChars;


	ret := '';
	for i:= 1 to charsn do
	begin
	    pom := makeall('',chars[i]);
	    if length(pom)>length(ret) then ret:=pom;
	end;
	if length(ret)=0 then Writeln('IDENTITY LOST')
	else
    	    writeln(ret);
    end;
End.






