# -*- coding: utf-8 -*- """ No.587 七対子 https://yukicoder.me/problems/no/587 """ import sys from sys import stdin from collections import Counter input = stdin.readline def solve(S): ans = None chars = list(S) for c in Counter(chars).most_common(): if c[1] > 2: return 'Impossible' if c[1] == 1: if not ans is None: return 'Impossible' ans = c[0] return ans def main(args): S = input().strip() ans = solve(S) print(ans) if __name__ == '__main__': main(sys.argv[1:])