while 1:l=input().split()*8;exec("a,b,c,*l=l[:0:-1];b in a+c!=print(a+b+c);"*6)