# -*- coding: utf-8 -*-

def main():

    N, K = map(int, input().split())
    S = input()

    ans = list(S)
    ans[K - 1] = S[K - 1].lower()

    ans = ''.join(ans)

    print(ans)


if __name__ == "__main__":
    main() def main():

    N, K = map(int, input().split())
    S = input()

    ans = list(S)
    ans[K - 1] = S[K - 1].lower()

    ans = ''.join(ans)

    print(ans) main N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K S = input() S input() input ans = list(S) ans list(S) list S ans[K - 1] = S[K - 1].lower() ans[K - 1] ans K - 1 K 1 S[K - 1].lower() [K - 1].lower [K - 1] S K - 1 K 1 lower ans = ''.join(ans) ans ''.join(ans) ''.join '' join ans print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():

    N, K = map(int, input().split())
    S = input()

    ans = list(S)
    ans[K - 1] = S[K - 1].lower()

    ans = ''.join(ans)

    print(ans) def main():

    N, K = map(int, input().split())
    S = input()

    ans = list(S)
    ans[K - 1] = S[K - 1].lower()

    ans = ''.join(ans)

    print(ans) main
# -*- coding: utf-8 -*-

def main():

    N, K = map(int, input().split())
    S = input()

    ans = list(S)
    ans[K - 1] = S[K - 1].lower()

    ans = ''.join(ans)

    print(ans)


if __name__ == "__main__":
    main()