import java.util.Scanner

object Main extends App  {
  val sc = new Scanner(System.in)
  val n = sc.nextInt
  val k = sc.nextInt
  val s = sc.next

  val res = s.zipWithIndex.foldLeft(""){case (sum, (c,i)) =>
    if(i != k - 1) sum + c
    else sum + c.toString.toLowerCase
  }

  println(res)

}
