import scala.io.StdIn


object Main extends App {
  val Array(n, k)  = StdIn.readLine().split(" ").map(_.toInt)
  val s  = StdIn.readLine()

  def solve(k: Int, s : String): String = {
    s.zipWithIndex.foldLeft("") { (acc, v) =>
      if (v._2 == k - 1) acc + v._1.toString().toLowerCase() else  acc + v._1.toString()
    }

  }


  println(solve(k, s))

}
  


