import scala.io.StdIn._
object Main extends App {
  val Array(n, k) = readLine.trim.split(' ').map(_.toInt)
  val str = readLine.trim.toCharArray
  str(k - 1) = str(k - 1).toLower
  println(
    str.mkString("")
  )
}