for(r=readline;b=r(a=r(i=1));print(p,c))for(x=/\S+/g,y=/\S+/g,c=x(a)+y(b);d=x(a)+y(b);)c==d?p=i:i++