S = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" L = S.length puts gets.chomp.chars.map.with_index{|c,idx| S[(S.index(c) + (L - 1 - idx % L)) % L]}.join