#!/usr/bin/env python txt_input = input() S = list(txt_input) 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 if S.count(S[i]) == 1: print(S[i]) break else: pass else: pass else: print('Impossible')