def str_replace_to_lower() -> str:
    len_str, target_index = map(int, input().split())
    word = 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()) def str_replace_to_lower() -> str:
    len_str, target_index = map(int, input().split())
    word = input()
    list_of_word = list(word)
    list_of_word[target_index - 1] = list_of_word[target_index - 1].lower()

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

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

    return ''.join(list_of_word) str_replace_to_lower
def str_replace_to_lower() -> str:
    len_str, target_index = map(int, input().split())
    word = 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())