def anzanable?(a) a = a.abs return false if a % 100 > 0 return a.digits.uniq.size == 2 end a, b = gets.chomp.split.map(&:to_i) if anzanable?(a) && anzanable?(b) puts a * b / 10 elsif (a * b).abs <= 99999999 puts a * b else puts "E" end