import collections c = collections.Counter(input()) l = c.most_common() if len(l) == 7 and l[0][1] == 2: print(l[-1][0]) else: print('Impossible')