r=raw_input while 1:x=r();y=r();z=`zip(x,y)`;print z.rfind(z[1:34])/40,x[:3]+y[:3]