s = input() count = {} for c in s: if c not in count: count[c] = 0 count[c] += 1 if len(count) != 7: print('Impossible') exit() values = list(count.values()) values.sort() if values[0] != 1 or values[1] != 2 or values[6] != 2: print('Impossible') exit() for key in count: if count[key] == 1: print(key)