import sys
sys.setrecursionlimit(10**6)

#a = int(input())
#b = list(map(int, input().split()))
n, k = map(int, input().split())
s = input()
#s,t = input().split()
#a = [int(input()) for _ in range(n)]
#
#readline = sys.stdin.readline
#n,m = [int(i) for i in readline().split()]
#ab = [[int(i) for i in readline().split()] for _ in range(n)]

s = [ch for ch in s]
s[k-1] = s[k-1].lower()
s = ''.join(s)

print(s) import sys sys sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k s = input() s input() input ch for ch in s for ch in s ch s for ch in s ch s = [ch for ch in s] s [ch for ch in 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 s = [ch for ch in s] [ch for ch in s] s s = ''.join(s) ''.join(s) s k = map(int, input().split()) map(int, input().split()) k s = input() input() s n, k = map(int, input().split()) map(int, input().split()) n
import sys
sys.setrecursionlimit(10**6)

#a = int(input())
#b = list(map(int, input().split()))
n, k = map(int, input().split())
s = input()
#s,t = input().split()
#a = [int(input()) for _ in range(n)]
#
#readline = sys.stdin.readline
#n,m = [int(i) for i in readline().split()]
#ab = [[int(i) for i in readline().split()] for _ in range(n)]

s = [ch for ch in s]
s[k-1] = s[k-1].lower()
s = ''.join(s)

print(s)