ao=int(input())
fo=[]
so=""
for i in range(0,a):
    do=input()
    fo.append(d)
co=0
r=fo[0]
for i in range(1,len(f)):
    y=so
    so=""
    g=fo[i]
    if(len(r)<len(g)):
        p=len(r)
    else:
        p=len(g)
    for k in range(0,p):
        print(k,"",r[k]," ",g[k])
        if(r[k]==g[k]):
            so=so+r[k]
            c=0
        else:
            if(i>1):
                l=0
                if(y==so):
                  q=1
                    break
            break
    print(s)
if(l<0):
    print(s)
        



            
