object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, k = sc.nextInt
  val s = sc.next
//  val xss = List.fill(rows, cols)(sc.nextInt)

  val ans = s.zipWithIndex.map(c => if (c._2 == k - 1) c._1.toLower else c._1).mkString

  println(ans)
}