lib C fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64 end class String def to_i64 C.strtoll(self, nil, 10) end end def func(c, n) if 'a' <= c <= 'z' 'a' + (c - 'a' + n % 26) % 26 elsif 'A' <= c <= 'Z' 'A' + (c - 'A' + n % 26) % 26 else raise "!!!" end end s = read_line n = read_line.to_i64 puts s.each_char.map { |c| if '0' <= c <= '9' m = n + c.to_i if m > 9 "CpCzNkSuTbEoA".each_char.map { |c2| func(c2, m - 10) }.join else m.to_s end else func(c, n) end }.join