#!python3

def LI():
    return list(map(int, input().split()))

# input
N, K = LI()
S = input()


def main():
    ans = list(S)
    d = {
        "A": "a",
        "B": "b",
        "C": "c"
    }
    
    ans[K - 1] = d[S[K - 1]]
    print("".join(ans))


if __name__ == "__main__":
    main() def LI():
    return list(map(int, input().split()))

# input LI return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split N, K = LI() N LI() LI K S = input() S input() input def main():
    ans = list(S)
    d = {
        "A": "a",
        "B": "b",
        "C": "c"
    }
    
    ans[K - 1] = d[S[K - 1]]
    print("".join(ans)) main ans = list(S) ans list(S) list S d = {
        "A": "a",
        "B": "b",
        "C": "c"
    } d {
        "A": "a",
        "B": "b",
        "C": "c"
    } "A" "A" "a" "B" "B" "b" "C" "C" "c" ans[K - 1] = d[S[K - 1]] ans[K - 1] ans K - 1 K 1 d[S[K - 1]] d S[K - 1] S K - 1 K 1 print("".join(ans)) print "".join(ans) "".join "" join ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def LI():
    return list(map(int, input().split()))

# input def LI():
    return list(map(int, input().split()))

# input LI S = input() input() S def main():
    ans = list(S)
    d = {
        "A": "a",
        "B": "b",
        "C": "c"
    }
    
    ans[K - 1] = d[S[K - 1]]
    print("".join(ans)) def main():
    ans = list(S)
    d = {
        "A": "a",
        "B": "b",
        "C": "c"
    }
    
    ans[K - 1] = d[S[K - 1]]
    print("".join(ans)) main N, K = LI() LI() N K = LI() LI() K
#!python3

def LI():
    return list(map(int, input().split()))

# input
N, K = LI()
S = input()


def main():
    ans = list(S)
    d = {
        "A": "a",
        "B": "b",
        "C": "c"
    }
    
    ans[K - 1] = d[S[K - 1]]
    print("".join(ans))


if __name__ == "__main__":
    main()
