require 'prime' A = Array.new(65, &:itself) .tap{|it| it[6] = it[28] = "Kanzensu!" } .tap{|it| (2 .. 4).each{|i| it[i**3] = "Ripposu!" } } .tap{|it| (2 .. 8).each{|i| it[i**2] = "Heihosu!" } } .tap{|it| (1 .. 64).each{|i| it[i] = "Sosu!" if i.prime? } } puts A[gets.to_i]