process.stdin.resume();
process.stdin.setEncoding('utf8'); 
var lines = [];
var reader = require('readline').createInterface({
	input: process.stdin,
	output: process.stdout
});
 
reader.on('line', (line) => {
	lines.push(line);
});

reader.on('close', () => {
	"use strict"
	const N = +lines[0].split(" ")[0];
	const K = +lines[0].split(" ")[1];
	const S = lines[1];
	let ans = "";
	
	for(let i=0; i<N; i++){
		ans += i==K-1 ? S[i].toLowerCase() : S[i];
	}
	console.log(ans);
});