a[999],s,t;main(x){for(;(x=getchar())-10;s+=2/++a[x])t=a[x]?t:x;printf(s/20?"%c":"Impossible",t);}