class WowCode attr_reader :s def initialize(s: "") @s = s @alphabet = ('A'..'Z').to_a end def cause begin @s = gets.chomp rescue end end def decoding(str) str = str.split("") r = str.each_with_index.map do |c, i| @alphabet[((c.ord-(i+1))-("A".ord)) % @alphabet.size] end r.join("") end def result puts decoding(@s) end def run cause result end end if $0 == __FILE__ WowCode.new.run end