object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val ls = in(0).split(' ').map(_.toInt)
  val K = ls(1) - 1
  val S = in(1).toArray
  val diff = ('A'.toInt - 'a'.toInt)
  if('A' <= S(K) && S(K) <= 'C' )
  S(K) = (S(K).toInt - diff).toChar
  else
  S(K) = (S(K).toInt + diff).toChar
  S.map(print)
  println("")
}
