import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, K = map(int, input().split())
    S = list(input())
    S[K - 1] = S[K - 1].lower()
    print(''.join(S))


if __name__ == '__main__':
    solve() import sys sys input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def solve():
    N, K = map(int, input().split())
    S = list(input())
    S[K - 1] = S[K - 1].lower()
    print(''.join(S)) solve N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K S = list(input()) S list(input()) list input() input 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 print(''.join(S)) print ''.join(S) ''.join '' join S if __name__ == '__main__':
    solve() __name__ == '__main__' __name__ '__main__' solve() solve input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input def solve():
    N, K = map(int, input().split())
    S = list(input())
    S[K - 1] = S[K - 1].lower()
    print(''.join(S)) def solve():
    N, K = map(int, input().split())
    S = list(input())
    S[K - 1] = S[K - 1].lower()
    print(''.join(S)) solve
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, K = map(int, input().split())
    S = list(input())
    S[K - 1] = S[K - 1].lower()
    print(''.join(S))


if __name__ == '__main__':
    solve()
