from collections import Counter s = input() d = Counter() list = [''] * 15 for c in s: d[c] += 1 for k in d: list[d[k]] += k if len(list[1]) == 1 and len(list[2]) == 6: print(list[1]) else: print('Impossible')