import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n, k = M()
s = S()
ans = ''
for i in range(1, n+1):
    c = s[i-1]
    if i == k:
        c = c.lower()
    ans += c
print(ans) import bisect,collections,copy,heapq,itertools,math,string bisect collections copy heapq itertools math string import sys sys def S(): return sys.stdin.readline().rstrip() S def M(): return map(int,sys.stdin.readline().rstrip().split()) M def I(): return int(sys.stdin.readline().rstrip()) I def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI def LS(): return list(sys.stdin.readline().rstrip().split()) LS n, k = M() n M() M k s = S() s S() S ans = '' ans '' for i in range(1, n+1):
    c = s[i-1]
    if i == k:
        c = c.lower()
    ans += c i range(1, n+1) range 1 n+1 n 1 c = s[i-1] c s[i-1] s i-1 i 1 if i == k:
        c = c.lower()
     i == k i k c = c.lower() c c.lower() c.lower c lower ans += c ans c print(ans) print ans def M(): return map(int,sys.stdin.readline().rstrip().split()) def M(): return map(int,sys.stdin.readline().rstrip().split()) M c = s[i-1] s[i-1] c def LS(): return list(sys.stdin.readline().rstrip().split()) def LS(): return list(sys.stdin.readline().rstrip().split()) LS def I(): return int(sys.stdin.readline().rstrip()) def I(): return int(sys.stdin.readline().rstrip()) I ans += c c ans k = M() M() k def S(): return sys.stdin.readline().rstrip() def S(): return sys.stdin.readline().rstrip() S s = S() S() s c = c.lower() c.lower() c def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) LI n, k = M() M() n ans = '' '' ans
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n, k = M()
s = S()
ans = ''
for i in range(1, n+1):
    c = s[i-1]
    if i == k:
        c = c.lower()
    ans += c
print(ans)