import sys

# gcd

from fractions import gcd

# 切り上げ，切り捨て

# from math import ceil, floor

# リストの真のコピー（変更が伝播しない）

# from copy import deepcopy

# 累積和。list(accumulate(A))としてAの累積和

from itertools import accumulate

# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']

# S = Counter(l)  # カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})

# print(S.most_common(2))  # [('b', 5), ('c', 4)]

# print(S.keys())  # dict_keys(['a', 'b', 'c'])

# print(S.values())  # dict_values([3, 5, 4])

# print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])

# from collections import Counter

# import math

# from functools import reduce

#

# input関係の定義

# import os

# fin = open('in_2.txt', 'r')

# sys.stdin = fin

input = sys.stdin.readline

def ii(): return int(eval(input()))

def mi(): return list(map(int, input().rstrip().split()))

def lmi(): return list(map(int, input().rstrip().split()))

def li(): return list(input().rstrip())

# template





def iterate_tokens():

    for line in sys.stdin:

        for word in line.split():

            yield word





if __name__ == '__main__':



    # tokens = iterate_tokens()

    # N = int(next(tokens))  # type: int

    # K = int(next(tokens))  # type: int

    # S = next(tokens)  # type: str

    N, K = mi()

    S = li()



    # write code

    A = list(S)

    A[K-1] = A[K-1].lower()

    print((''.join(A)))

import sys

# gcd

from fractions import gcd

# 切り上げ，切り捨て

# from math import ceil, floor

# リストの真のコピー（変更が伝播しない）

# from copy import deepcopy

# 累積和。list(accumulate(A))としてAの累積和

from itertools import accumulate

# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']

# S = Counter(l)  # カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})

# print(S.most_common(2))  # [('b', 5), ('c', 4)]

# print(S.keys())  # dict_keys(['a', 'b', 'c'])

# print(S.values())  # dict_values([3, 5, 4])

# print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])

# from collections import Counter

# import math

# from functools import reduce

#

# input関係の定義

# fin = open('in_1.txt', 'r')

# sys.stdin = fin

input = sys.stdin.readline

def ii(): return int(eval(input()))

def mi(): return list(map(int, input().rstrip().split()))

def lmi(): return list(map(int, input().rstrip().split()))

def li(): return list(input().rstrip())

# template





def iterate_tokens():

    for line in sys.stdin:

        for word in line.split():

            yield word





if __name__ == '__main__':



    tokens = iterate_tokens()

    N = int(next(tokens))  # type: int

    K = int(next(tokens))  # type: int

    S = list(next(tokens))  # type: str



    # write code

    S[K-1] = S[K-1].lower()

    print((''.join(S)))

import sys

# gcd
from fractions import gcd

# 切り上げ，切り捨て
# from math import ceil, floor
# リストの真のコピー（変更が伝播しない）
# from copy import deepcopy
# 累積和。list(accumulate(A))としてAの累積和
from itertools import accumulate

# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']
# S = Counter(l)  # カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})
# print(S.most_common(2))  # [('b', 5), ('c', 4)]
# print(S.keys())  # dict_keys(['a', 'b', 'c'])
# print(S.values())  # dict_values([3, 5, 4])
# print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])
# from collections import Counter
# import math
# from functools import reduce
#
# input関係の定義
# import os
# fin = open('in_2.txt', 'r')
# sys.stdin = fin
input = sys.stdin.readline


def ii():
    return int(eval(input()))


def mi():
    return list(map(int, input().rstrip().split()))


def lmi():
    return list(map(int, input().rstrip().split()))


def li():
    return list(input().rstrip())


# template
def iterate_tokens():
    for line in sys.stdin:
        for word in line.split():
            yield word


if __name__ == "__main__":
    # tokens = iterate_tokens()
    # N = int(next(tokens))  # type: int
    # K = int(next(tokens))  # type: int
    # S = next(tokens)  # type: str
    N, K = mi()
    S = li()
    # write code
    A = list(S)
    A[K - 1] = A[K - 1].lower()
    print(("".join(A)))

import sys

# gcd
from fractions import gcd

# 切り上げ，切り捨て
# from math import ceil, floor
# リストの真のコピー（変更が伝播しない）
# from copy import deepcopy
# 累積和。list(accumulate(A))としてAの累積和
from itertools import accumulate

# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']
# S = Counter(l)  # カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})
# print(S.most_common(2))  # [('b', 5), ('c', 4)]
# print(S.keys())  # dict_keys(['a', 'b', 'c'])
# print(S.values())  # dict_values([3, 5, 4])
# print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])
# from collections import Counter
# import math
# from functools import reduce
#
# input関係の定義
# fin = open('in_1.txt', 'r')
# sys.stdin = fin
input = sys.stdin.readline


def ii():
    return int(eval(input()))


def mi():
    return list(map(int, input().rstrip().split()))


def lmi():
    return list(map(int, input().rstrip().split()))


def li():
    return list(input().rstrip())


# template
def iterate_tokens():
    for line in sys.stdin:
        for word in line.split():
            yield word


if __name__ == "__main__":
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    S = list(next(tokens))  # type: str
    # write code
    S[K - 1] = S[K - 1].lower()
    print(("".join(S)))

-# import os -# fin = open('in_2.txt', 'r') +# fin = open('in_1.txt', 'r') -    # tokens = iterate_tokens() -    # N = int(next(tokens))  # type: int -    # K = int(next(tokens))  # type: int -    # S = next(tokens)  # type: str -    N, K = mi() -    S = li() +    tokens = iterate_tokens() +    N = int(next(tokens))  # type: int +    K = int(next(tokens))  # type: int +    S = list(next(tokens))  # type: str -    A = list(S) -    A[K - 1] = A[K - 1].lower() -    print(("".join(A))) +    S[K - 1] = S[K - 1].lower() +    print(("".join(S)))