ans={} for i in input(): if i not in ans: ans[i]=1 else: ans[i]+=1 check=[*ans.values()] if check.count(2)==6 and check.count(1)==1: print(*[i for i,j in ans.items() if j==1]) else: print('Impossible')