import math


def main():
    # n = int(input())
    n, k = map(int, input().split())
    # h = list(map(int, input().split()))
    s = list(input())
    # h = [int(input()) for _ in rane(n)]

    s[k-1] = s[k-1].lower()
    print("".join(s))


if __name__ == '__main__':
    main() import math math def main():
    # n = int(input())
    n, k = map(int, input().split())
    # h = list(map(int, input().split()))
    s = list(input())
    # h = [int(input()) for _ in rane(n)]

    s[k-1] = s[k-1].lower()
    print("".join(s)) main n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k s = list(input()) s list(input()) list input() input s[k-1] = s[k-1].lower() s[k-1] s k-1 k 1 s[k-1].lower() [k-1].lower [k-1] s k-1 k 1 lower print("".join(s)) print "".join(s) "".join "" join s if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    # n = int(input())
    n, k = map(int, input().split())
    # h = list(map(int, input().split()))
    s = list(input())
    # h = [int(input()) for _ in rane(n)]

    s[k-1] = s[k-1].lower()
    print("".join(s)) def main():
    # n = int(input())
    n, k = map(int, input().split())
    # h = list(map(int, input().split()))
    s = list(input())
    # h = [int(input()) for _ in rane(n)]

    s[k-1] = s[k-1].lower()
    print("".join(s)) main
import math


def main():
    # n = int(input())
    n, k = map(int, input().split())
    # h = list(map(int, input().split()))
    s = list(input())
    # h = [int(input()) for _ in rane(n)]

    s[k-1] = s[k-1].lower()
    print("".join(s))


if __name__ == '__main__':
    main()
