from collections import defaultdict s = input() dd = defaultdict(int) for c in s: dd[c] += 1 a, b = 0, 0 c = "" for d in dd: if dd[d] == 2: b += 1 elif dd[d] == 1: a += 1 c = d print(c if (a, b) == (1, 6) else "Impossible")