#!/usr/bin/env python txt_input = input() S = list(txt_input) letter = '' S.sort() print(S) S_unique = list(set(S)) print(len(S_unique)) if len(S_unique) == 7: for i in range(len(S)): if S.count(S[i]) >= 3: print('Impossible') break else: if S.count(S[i]) == 1: letter = S[i] print(letter) else: print('Impossible')