from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

def main():
    n, k = map(int, input().split())
    s = input()
    print(s[:k-1] + s[k-1].lower() + s[k:])

main() from sys import setrecursionlimit, exit setrecursionlimit(1000000000) setrecursionlimit 1000000000 def main():
    n, k = map(int, input().split())
    s = input()
    print(s[:k-1] + s[k-1].lower() + s[k:]) 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 print(s[:k-1] + s[k-1].lower() + s[k:]) print s[:k-1] + s[k-1].lower() + s[k:] s[:k-1] + s[k-1].lower() s[:k-1] s :k-1 k-1 k 1 s[k-1].lower() [k-1].lower [k-1] s k-1 k 1 lower s[k:] s k: k main() main def main():
    n, k = map(int, input().split())
    s = input()
    print(s[:k-1] + s[k-1].lower() + s[k:]) def main():
    n, k = map(int, input().split())
    s = input()
    print(s[:k-1] + s[k-1].lower() + s[k:]) main
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

def main():
    n, k = map(int, input().split())
    s = input()
    print(s[:k-1] + s[k-1].lower() + s[k:])

main()