program rot_b
    implicit none
    integer(4):: n, i, j
    character(10000):: s, ns
    character(52), parameter:: alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
    read*, n
    read*, s
    do i=1,len_trim(s)
        do j=1, 26
            if (alphabet(j:j) == s(i:i))then
                ns(i:i) = alphabet(j+n:j+n)
            end if
        end do
    end do
    print"(a)", trim(ns(1:len_trim(s)))
end program rot_b