while 1:s=input();len({tuple(map(x.find,x))for x in s.split()})<2!=print(s)