import sys

stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


n, k = nm()
k -= 1
S = list(input())
S[k] = S[k].lower()
print(''.join(S)) import sys sys stdin = sys.stdin stdin sys.stdin sys stdin def ns(): return stdin.readline().rstrip() ns def ni(): return int(stdin.readline().rstrip()) ni def nm(): return map(int, stdin.readline().split()) nm def nl(): return list(map(int, stdin.readline().split())) nl n, k = nm() n nm() nm k k -= 1 k 1 S = list(input()) S list(input()) list input() input S[k] = S[k].lower() S[k] S k S[k].lower() [k].lower [k] S k lower print(''.join(S)) print ''.join(S) ''.join '' join S def nl(): return list(map(int, stdin.readline().split())) def nl(): return list(map(int, stdin.readline().split())) nl k = nm() nm() k n, k = nm() nm() n def ns(): return stdin.readline().rstrip() def ns(): return stdin.readline().rstrip() ns k -= 1 1 k stdin = sys.stdin sys.stdin stdin def ni(): return int(stdin.readline().rstrip()) def ni(): return int(stdin.readline().rstrip()) ni def nm(): return map(int, stdin.readline().split()) def nm(): return map(int, stdin.readline().split()) nm S = list(input()) list(input()) S
import sys

stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


n, k = nm()
k -= 1
S = list(input())
S[k] = S[k].lower()
print(''.join(S))