S = input() L = list(S) D = {} for i in L: if i in D.keys(): D[i] += 1 else: D[i] = 1 cnt_0 = 0 for key, value in D.items(): if value == 2: cnt_0 += 1 if value == 1: d = key if cnt_0 == 6: print(d) else: print("Impossible")