object Main {
  def main(args:Array[String]) = {
    val arr =  readLine.split(" ").map(_ .toInt)
    val out = readLine.split("").takeRight(arr(0))
    for (x <-0 until arr(0)){
      if (( x+1) == arr(1) ){
      	print(out(x)toLowerCase)
      }else{
        print(out(x))
      }  
    }
  }
}