while+1:_=zip(*eval("raw_input().split(),"*2));print+_.index(_[0],1),"%s%s"%_[0]