
object Main extends App {
  val num = scala.io.StdIn.readLine.toInt
  val str = scala.io.StdIn.readLine

  println(RotCharList(str) rot num rawString())
}

class RotChar(val symbol: Char) {
  def rot(num: Int): RotChar = {
    val rotSymbol = symbol + num.toChar
    RotChar((if (rotSymbol > 'Z') {
      rotSymbol - ('Z' - 'A') - 1
    } else {
      rotSymbol
    }).toChar)
  }

  override def toString: String = symbol.toString

  override def equals(that: Any): Boolean = {
    that match {
      case that: RotChar => this.symbol == that.symbol
      case _ => false
    }
  }
}

object RotChar {
  def apply(symbol: Char) = new RotChar(symbol)
}


class RotCharList(val value: Seq[RotChar]) {
  def rot(num: Int) = {
    new RotCharList(value.map(_.rot(3)))
  }

  override def equals(that: Any): Boolean = {
    that match {
      case that: RotCharList => this.value == that.value
      case _ => false
    }
  }

  def rawString(): String = {
    value map(_.symbol) mkString
  }
}

object RotCharList {
  def apply(value: String): RotCharList = {
    new RotCharList(value.map(RotChar.apply))
  }
}