import sys tmp_s = "abcdefghijklm" dic = {} for i in tmp_s: dic[i] = 0 s = raw_input() n0 = len(tmp_s) n1 = 0 n2 = 0 for i in s: if i not in tmp_s: print "Impossible" sys.exit() elif dic[i] == 3: print "Impossible" sys.exit() else: dic[i] += 1 if dic[i] == 2: n1 -= 1 n2 += 1 elif dic[i] == 1: n0 -= 1 n1 += 1 keys = dic.keys() if n2 == 1 and n0 == 1: for i in keys: if dic[i] == 0: print i break elif n0 == 0 and n2 == 0: for i in tmp_s: print i else: print "Impossible"