import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons, std.uni;

void main() {
    const tmp = readln.split.to!(int[]);
    const N = tmp[0], K = tmp[1];
    const S = readln.chomp;
    S.enumerate.map!(c => c.index + 1 == K ? c.value.toLower : c.value).array.to!string.writeln;
}

