#!/usr/bin/env python slist = list(input()) num1 = [] for s in set(slist): if slist.count(s) >= 3: print('Impossible') exit() elif slist.count(s) == 1: num1.append(s) if len(num1) == 1: print(num1[0]) else: print('Impossible')