a[999],t;main(i){for(;a[++i]&~2?t=a[*a=i]>1|t?"Impossible":a:i<128;)a[getchar()]++;puts(t);}