strs = gets.chomp.split("").map(&:to_s) res = Array.new strs.each{|val| res << val if strs.count(val) == 1} puts res.length == 1 && strs.uniq.length == 7 ? res : "Impossible"