def ABC_126_A():
    N,K = map(int, input().split())
    S = input()
    S = list(S)
    S[K-1] = S[K-1].lower()
    S = ''.join(S)

    print(S)


if __name__ == '__main__':

    ABC_126_A() def ABC_126_A():
    N,K = map(int, input().split())
    S = input()
    S = list(S)
    S[K-1] = S[K-1].lower()
    S = ''.join(S)

    print(S) ABC_126_A N,K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K S = input() S input() input S = list(S) S list(S) list S 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 S = ''.join(S) S ''.join(S) ''.join '' join S print(S) print S if __name__ == '__main__':

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

    print(S) def ABC_126_A():
    N,K = map(int, input().split())
    S = input()
    S = list(S)
    S[K-1] = S[K-1].lower()
    S = ''.join(S)

    print(S) ABC_126_A
def ABC_126_A():
    N,K = map(int, input().split())
    S = input()
    S = list(S)
    S[K-1] = S[K-1].lower()
    S = ''.join(S)

    print(S)


if __name__ == '__main__':

    ABC_126_A()