#!/usr/bin/ruby
# encoding: utf-8

N,K = gets.split.map(&:to_i)
S = gets.chomp

str = Array.new(N,"")

(0..N-1).each do |i|
  if i == K-1
    str[i] += S[i].downcase
  elsif
    str[i] += S[i]
  end
end

puts str.join
