def str_replace_to_lower() -> str:

    len_str, target_index = list(map(int, input().split()))

    word = eval(input())

    list_of_word = list(word)

    list_of_word[target_index - 1] = list_of_word[target_index - 1].lower()



    return ''.join(list_of_word)





print((str_replace_to_lower()))
n, k = list(map(int, input().split()))

s = list(eval(input()))



tmp = s.pop(k - 1)

l = tmp.lower()

s.insert(k - 1, l)

print((''.join(s)))

def str_replace_to_lower() -> str:
    len_str, target_index = list(map(int, input().split()))
    word = eval(input())
    list_of_word = list(word)
    list_of_word[target_index - 1] = list_of_word[target_index - 1].lower()
    return "".join(list_of_word)


print((str_replace_to_lower()))

n, k = list(map(int, input().split()))
s = list(eval(input()))
tmp = s.pop(k - 1)
l = tmp.lower()
s.insert(k - 1, l)
print(("".join(s)))

-def str_replace_to_lower() -> str: -    len_str, target_index = list(map(int, input().split())) -    word = eval(input()) -    list_of_word = list(word) -    list_of_word[target_index - 1] = list_of_word[target_index - 1].lower() -    return "".join(list_of_word) - - -print((str_replace_to_lower())) +n, k = list(map(int, input().split())) +s = list(eval(input())) +tmp = s.pop(k - 1) +l = tmp.lower() +s.insert(k - 1, l) +print(("".join(s)))