while 1:S=raw_input()+';';exec S*9+"print %s"%S[-2]in{c:0for c in S}