# Here your code ! ACTORS = %w/digi petit rabi gema piyo/ class String def normalize self.downcase.gsub(/\s/,'Z').gsub(/[^a-zZ]/,'!') end def digi? self =~ /nyo!{0,3}\Z/ end def petit? self =~ /nyu!{0,3}\Z/ end def rabi? self =~ /[Z!]/ end def gema? self =~ /gema!{0,3}\Z/ end def piyo? self =~ /pyo!{0,3}\Z/ end end STDIN.each_line do |line| a, v = line.chomp.split(' ',2) unless ACTORS.include?(a) puts "WRONG!" next end if v.nil? puts "WRONG!" next end if v.normalize.send("#{a}?".to_sym) puts "CORRECT (maybe)" else puts "WRONG!" end end