str = gets.strip str.length.times do |i| str[i] = (((str[i].ord - 40 - (i % 26)) % 26) + 65).chr end puts str