object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val k = sc.nextInt
    val s = sc.next
    sc.close()

    val result = s.zipWithIndex.map { case (c, i) => if (i == k - 1) c.toLower else c }
    println(result.mkString(""))
  }
}