import math import sys def S(): return sys.stdin.readline().rstrip() def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int, sys.stdin.readline().rstrip().split()) def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) def LS(): return list(sys.stdin.readline().rstrip().split()) s = S() s_set = set(list(s)) if len(s_set) != 7: print("Impossible") else: flag = 0 for i in s_set: if s.count(i) == 2: continue elif s.count(i) > 2: print("Impossible") break elif s.count(i) == 1: if flag == 1: print("Impossible") break else: ans = i flag = 1 else: print(ans)