for(<>=~/./g){ if(++$a{$_}>2){ print "Impossible"; exit; } } @b=grep$a{$_}==1,a..z; if(@b>1){ print "Impossible"; exit; } print@b;