n,*l=open(0).read().split() count_num=0 n=int(n) a=l[:n];b=l[n:] for i in range(n): count_num+=1 if a[i]!=b[i]: print(count_num,a[i],b[i],sep="\n")