program ROT_N
  implicit none
  integer :: n, l, i
  character(10000) :: s
  read(*,*) n
  read(*,*) s
  l = len_trim(s)
  do i = 1, l
    s(i:i) = achar(mod(ichar(s(i:i))-65+n,26)+65)
  end do
  write(*,'(a)') trim(s)
end program ROT_N