#!/usr/bin/env python3 import sys def main(): S = input() l = [0] * 7 for ss in S: if ord(ss) - ord("a") > 6: print("Impossible") return l[ord(ss) - ord("a")] += 1 if sorted(l) == [1] + [2] * 6: print(chr(l.index(1) + ord("a"))) else: print("Impossible") if __name__ == '__main__': main()