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

def replace(s, k)
  if s[k - 1] == 'A'
    s[k - 1] = 'a'
  elsif s[k - 1] == 'B'
    s[k - 1] = 'b'
  else
    s[k - 1] = 'c'
  end
end

replace(S, K)

puts S.join