# coding: utf-8 def main(): s = input() d = count(s) e = list(filter(lambda t: t[1] != 2, d.items())) if len(e) == 1 and e[0][1] == 1: print(e[0][0]) else: print('Impossible') def count(s): return { c: len(list(filter(lambda x: x == c, s))) for c in set(s) } if __name__ == '__main__': main()