import sys input=lambda: sys.stdin.readline().rstrip() import collections S=collections.Counter(list(input())) if max(S.values())!=2 or len(S.keys())!=7: print("Impossible") else: for x in S.keys(): if S[x]==1: print(x) break