s=gets.chomp puts (('a'..'z').select{|c|(s+c).chars.group_by{|d|d}.all?{|k,v|v.size==2}}+['Impossible'])[0]