from collections import Counter S = input() c = Counter(S) values = sorted(list(c.values())) if values[0] != 1: print('Impossible') exit() if values[1] != 2: print('Impossible') exit() if values[-1] != 2: print('Impossible') exit() for key, value in zip(c.keys(), c.values()): if value == 1: print(key)