from collections import * S = Counter(input()) D = defaultdict(int) for k, v in S.items(): D[v] += 1 if not (D[2] == 6 and D[1] == 1): print("Impossible") else: for k, v in S.items(): if v == 1: print(k)