a = gets.chomp.chars a << x = a.find{|c|a.count(c)<2} puts a.group_by{|c|c}.map{|k,v|v.size}.uniq==[2] ? x : :Impossible