from itertools import groupby s = input() se = set(s) freq = [len(list(group)) for key, group in groupby(s)] f = {len(list(group)):key for key, group in groupby(s)} num2 = len(list(filter(lambda x :x==2,freq))) if num2==6 and len(s)==7: print(f[1]) else: print("Impossible")