import collections s = input() s_clc = collections.Counter(list(s)) one_count = 0 two_count = 0 target_char = None for key in s_clc.keys(): if s_clc[key] == 1: one_count += 1 target_char = key elif s_clc[key] == 2: two_count += 1 res = None if one_count == 1 and two_count == 6: res = target_char else: res = 'Impossible' print(res)