# No.587 七対子 s = input() pool = [] nums = [] for w in s: if w not in pool: pool.append(w) nums.append(s.count(w)) if len(pool) == 7 and max(nums) == 2: print(pool[nums.index(1)]) else: print('Impossible')