input = gets.chomp.split
n = input[0].to_i
k = input[1].to_i
s = gets.chomp.split("")

for i in 1..n do
    if (i==k) 
        tar = s[i-1]
        if tar == "A"
            print "a"
        elsif tar == "B"
            print "b"
        elsif tar == "C"
            print "c"
        end
    else
        print s[i-1]
    end
end