

  var pttWord:string;
      n,i:integer;
      a:array[1..20] of string;
      k,l:integer;
      len:array[1..20] of longint;
      minV,maxV:integer;
      mn,mx:longint;
      pn,px:integer;
      psb:array[1..100]of string;
      psbN:integer;
      bla:integer;

    BEGIN
      readln(n);
      for i:=1 to n do
        begin
            readln(a[i]);
          len[i]:=length(a[i]);
        end;

       pn:=1;mn:=len[1];
       for i :=2 to n do if len[i]<mn then begin mn:=len[i]; pn:=i; end;
       maxV:=mn div 2;
       minV:=mn div 10;

       px:=1; mx:=len[1];
       for i:=2 to n do if len[i]>mx then begin mx:=len[i]; px:=i; end;

       {writeln(a[px]);
       writeln(a[pn]);}

        for i :=1 to len[pn]-minV do
         begin
          pttword:=copy(a[pn],i,minV);
          if pos(pttword,a[px])<>0 then
            begin
             inc(psbN);
              bla:=pos(pttword,a[px]);
              l:=i;
              pttword:='';
               while a[l]=a[bla] do
                begin
                 pttword:=pttword+a[px][l];
                 inc(l);inc(bla);
                end;
               psb[psbn]:=pttword;
            end;
         end;

      for i:=1 to psbn do
      writeln(psb[i]);


    END.