"use strict";

const stringToIntDecimal = s => parseInt(s);

const readData = input => {
  const inputArray = input.split("\n");
  const numberArray = inputArray[0].split(" ").map(stringToIntDecimal);

  return {
    length: numberArray[0],
    operandNumber: numberArray[1],
    str: inputArray[1]
  };
};

function Main(input) {
  let data = readData(input);
  const index = data.operandNumber - 1;
  const inputString = data.str;
  let outputString =
    inputString.substring(0, index) +
    inputString.charAt(index).toLowerCase() +
    inputString.substring(index + 1, data.length);
  console.log(outputString);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));