import collections S = list(input()) cnt = collections.Counter(S) vls = list(cnt.values()) if vls.count(1) == 1 and vls.count(2)==6: for key,val in cnt.items(): if val == 1: print(key) exit() print('Impossible')