import scala.io.{StdIn => in}
import java.lang.{Character => char}

object Main extends App {
  val Array(n, k) = in.readLine.split(" ").map(_.toInt)
  val s = in.readLine
  val ans = s.take(k-1) + char.toLowerCase(s(k-1)) + s.drop(k)
  println(ans)
}