fun main(args:Array<String>){
  var (n,m) = readLine()!!.split(" ").map(String::toInt)
  var s = readLine()!!.toCharArray()
  when(s[m-1]){
    'A' -> s[m-1] = 'a'
    'B' -> s[m-1] = 'b'
    'C' -> s[m-1] = 'c'
  }
  for(i in 0..n-1){
    print(s[i])
  }
  println()
}