Problem:
 Score : 100 points    Problem Statement You are given a string S of length N consisting of A , B and C , and an integer K which is between 1 and N (inclusive).
Print the string S after lowercasing the K -th character in it.      Constraints  1 ≤ N ≤ 50  1 ≤ K ≤ N  S is a string of length N consisting of A , B and C .         Input Input is given from Standard Input in the following format:  N  K  S       Output Print the string S after lowercasing the K -th character in it.        Sample Input 1 3 1
ABC      Sample Output 1 aBC       Sample Input 2 4 3
CABA      Sample Output 2 CAbA

Solution (Python):
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq as hq
import itertools as its
import operator as op



inf = float('inf')
N = 0


def set_inputs():
    global N
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    
    n, k = get_li()
    s = get_lc()
    if s[k-1] == 'A':
        s[k-1] = 'a'
    elif s[k-1] == 'B':
        s[k-1] = 'b'
    else:
        s[k-1] = 'c'
    print(''.join(s))
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input().strip()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().strip().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int,input().split())
S = input()
ans = S[:K-1]+S[K-1].lower() + S[K:]
print(ans)

Solution (Python):
n, k = map(int, input().split())
s = input()
result = ''
for i, c in enumerate(s):
    if i == k-1:
        if c == 'A':
            result += 'a'
        elif c == 'B':
            result += 'b'
        elif c == 'C':
            result += 'c'
    else:
        result += c
print(result)

Solution (Python):
N,K = map(int,input().split())
S = input()
S = list(S)

if S[K-1] == "A":
    S[K-1] = "a"

if S[K-1] == "B":
    S[K-1] = "b"

if S[K-1] == "C":
    S[K-1] = "c"
    
print("".join(S))

Solution (Python):
n,k = list(map(int, input().split()))
s = list(input())

if s[k-1] == "A":
    s[k-1] = "a"
elif s[k-1] == "B":
    s[k-1] = "b"
else:
    s[k-1] = "c"
print(''.join(s))

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

Solution (Python):
import sys
from collections import Counter
import string

n,k = map(int, input().split())
s = input()
k = k-1
print(s[:k]+s[k].lower()+s[k+1:])

Solution (Python):
import math
from functools import reduce

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]


def get_nums_l():
    return [ int(s) for s in input().split(" ")]


def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

n,k = get_nums_l()
k -= 1
s = input()

ans = ""
for i in range(n):
    c = s[i]
    if i == k:
        ans += c.lower()
    else:
        ans += c

print(ans)

Solution (Python):
N, K = map(int, input().split())
S = list(input())

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

print("".join(S))

Solution (Python):
N, K = list(map(int, input().split()))
S = input()
T = ""

for i in range(N):
    if i + 1 == K:
        T += S[i].lower()
    else:
        T += S[i]

print (T)

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

Solution (Python):
N,K = map(int,input().split())
S = input()
s = S[K-1]

print(S[:K-1]+s.lower()+S[K:])

Solution (Python):
def solve():
    n, k = map(int, input().split())
    S= input()    
    S = list(S)
    S[k-1] = chr( ord(S[k-1]) - ord("A") + ord("a"))
    print("".join(S))
if __name__ == "__main__":
  solve()

Solution (Python):
n,k = map(int,input().split())
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Solution (Python):
N, K = [int(c) for c in input().split()]
S = input()

O = ''
for i,c in enumerate(S):
    O += c if i+1 != K else c.lower()

print(O)

Solution (Python):
n,k=map(int,input().split())
c=input()
print(c[:k-1]+c[k-1].lower()+c[k:])

Solution (Python):
N, K = list(map(int, input().split()))
S = input()

print(S[:K-1] + S[K-1].lower() + S[K:])

Solution (Python):
N,K = [int(i) for i in input().split()]
S = list(input())

ans = ''
for i,j in enumerate(S):
    if i == K-1:
        ans += S[i].lower()
    else:
        ans += S[i]
print(ans)

Solution (Python):
n,k = map(int, input().split())
s = list(input())
if s[k-1] == "A":
    s[k-1] = 'a'
elif s[k-1] == "B":
    s[k-1] = 'b'
else:
    s[k-1] = 'c'

print("".join(s))

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n,k = f()
    s = input()
    for i in range(n):
        if i == k-1:
            if s[i] == 'A':
                print('a', end= '')
            if s[i]== 'B':
                print('b', end='')
            if s[i] == 'C':
                print('c', end='')
        else:
        
            print(s[i], end = '')
    
    print()

solve()

Solution (Python):
N, K = map(int, input().split())
S = list(input())
s = S[K-1]
if s == 'A':
    S[K-1] = 'a'
elif s == 'B':
    S[K-1] = 'b'
else:
    S[K-1] = 'c'
print(*S, sep='')

Solution (Python):
a, b = map(int,input().split())
c = list(input())
c[b-1] = c[b-1].lower()
print("".join(c))

Solution (Python):
N,K=map(int,input().split())
S=input()
T=S[:K-1]
a=S[K-1].lower()
U=S[K:]
print(T+a+U)

Solution (Python):
n,k=map(int,input().split())
s=input()
print(s[:k-1] + s[k-1].lower() + s[k:])

Solution (Python):
n,k=map(int, input().split())  
s = input()
list_s =  list(s)
list_s[k-1] = list_s[k-1].lower()
print(''.join(list_s))

Solution (Python):
N, K = map(int, input().split())
S = list(input())

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

print("".join(S))

Solution (Python):

"""
A - Changing a Character
https://atcoder.jp/contests/abc126/tasks/abc126_a

"""
import sys


def solve(N, K, S):
    ans = ''
    for i, s in enumerate(S, start=1):
        if i == K:
            ans += s.lower()
        else:
            ans += s
    return ans


def main(args):
    N, K = map(int, input().split())
    S = input()
    ans = solve(N, K, S)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):
_, K = map(int, input().split())
S = input()
print(S[:K-1], S[K-1].lower(), S[K:], sep="")

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N,K=MAP()
S=list(input())

S[K-1]=S[K-1].lower()
print(''.join(S))

Solution (Python):
N, K = map(int,input().split())
S = input()
print(S[:K-1]+S[K-1].swapcase()+S[K:])

Solution (Python):
N, K = map(int, input().split())
S = input()

ans = S[:(K-1)] + S[K-1].lower() + S[K:]
print(ans)

Solution (Python):
N,K = [int(x) for x in input().split()]
S = input()
print(S[:K-1]+chr(ord(S[K-1])+32)+S[K:])

Solution (Python):
N, K = map(int, input().split())
S = input()

print(S[:K-1] + S[K-1].lower() + S[K:])

Solution (Python):

n, k = map(int, input().split())
s = list(input())

if s[k-1] == 'A': s[k-1] = 'a'
elif s[k-1] == 'B': s[k-1] = 'b'
elif s[k-1] == 'C': s[k-1] = 'c'

for i in range(n):
    print(s[i], end='')

Solution (Python):







import math, itertools, operator
from math import *
from math import factorial as fact
from itertools import permutations, combinations
from functools import reduce


from fractions import gcd

inf = float('inf')

def lcm(a, b):
    return a * b // gcd(a,b)

def perm(a, b):
    import scipy.special
    return scipy.special.perm(a, b, exact = True)

def comb(a, b):
    import scipy.special
    return scipy.special.comb(a, b, exact = True)

def dfact(n):
    import scipy.special
    return scipy.special.factorial2(n, exact = True)

def prod(l):
    return reduce(operator.mul, l)

def input_ints(inp = input, sep = ' ', conv = int):
    return map(conv, inp().split(sep = sep))




N, K = input_ints()
S = input()

S2 = S[:K-1] + S[K-1].lower() + S[K:]
print(S2)

Solution (Python):
N,K = map(int,input().split())
S= input()
print(S[0:K-1]+S[K-1].lower()+S[K:N])

Solution (Python):
n,k=[int(x) for x in input().split()]
s=input()
ans=""
for i in range(n):
    if i==k-1:
        ans+=s[i].lower()
    else:
        ans+=s[i]
print(ans)

Solution (Python):
a,b=tuple(map(int,input().split()))
c=input()
for i in range(a):
    if i!=b-1:
        print(c[i],end="")
    else:
        print(c[i].lower(),end="")

Solution (Python):
if __name__ == '__main__':
    n, k = map(int, input().split())
    s = input()
    print(''.join(c.lower() if i == k - 1 else c for i, c in enumerate(s)))

Solution (Python):
N, K = map(int, input().split())
S = list(input())
K -= 1
if S[K] == "A":
    S[K] = "a"
elif S[K] == "B":
    S[K] = "b"
elif S[K] == "C":
    S[K] = "c"


print("".join(S))

Solution (Python):
import sys
input=sys.stdin.readline

N,K=map(int,input().split())

S = input()
for i in range(len(S)):
  if i == K-1:
    print(S[i].lower(),end='')
  else:
    print(S[i],end='')

Solution (Python):
n,k = map(int, input().split(' '))
s = input()
k -= 1
ans = s[:k] + s[k].lower() + s[k+1:]
print(ans)

Solution (Python):
N, K =map(int, input().split())
st = input()
print(st[:K-1] + st[K-1].lower()+st[K:])

Solution (Python):
n,k = map(int,input().split())
s = list(input())

if s[k-1] =="A":
    s[k-1] = "a"
elif s[k-1] =="B":
    s[k-1] = "b"
else:
    s[k-1] = "c"
print(*s,sep="")

Solution (Python):

n, k = map(int,input().split())
s = input()
k -= 1
t = s[k].lower()
print(s[:k]+t+s[k+1:])

Solution (Python):
n, k = map(int, input().split())
s = str(input())

s = s[:k-1] + s[k-1].lower() + s[k:]
print(s)

Solution (Python):
N, K = map(int, input().split())
S = input()

for i, c in enumerate(S):
    print(c if i != K - 1 else c.lower(), end='')
print()

Solution (Python):
N, K = map(int, input().split())
S = input()
print(S[: K - 1] + S[K - 1].lower() + S[K:])

Solution (Python):
n,k = map(int,input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print(''.join(s))

Solution (Python):
n, k = map(int, input().split())
s = input()
for i in range(n):
    if i == k - 1:
        print(s[i].lower(), end = '')
    else:
        print(s[i], end = '')

Solution (Python):
n, k = map(int, input().split())
s = list(input().strip())
s[k - 1] = s[k - 1].lower()
print("".join(s))

Solution (Python):
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, K] = [int(input_raw[0]), int(input_raw[1])]
    input_raw = read_func().strip().split()
    S = input_raw[0]
    new_S = S[:K - 1] + S[K - 1].lower() + S[K:]
    print new_S
if __name__ == '__main__':
    main()

Solution (Python):
n, k = list(map(int, input().split()))
strings = input()
strings = list(strings)
strings[k - 1] = strings[k - 1].lower()
print(''.join(strings))

Solution (Python):
inp = input().split()
n = int(inp[0])
k = int(inp[1])
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Solution (Python):
N,K = map(int,input().split())
S = list(input())
K -= 1
if S[K] == 'A':
    S[K] = 'a'
elif S[K] == 'B':
    S[K] = 'b'
elif S[K] == 'C':
    S[K] = 'c'
print(''.join(S))

Solution (Python):


n, k = [int(i) for i in input().split()]

s = input()

if s[k-1] == "A":
    print(s[:k-1]+"a"+s[k:])

elif s[k-1] == "B":
    print(s[:k-1]+"b"+s[k:])
else:
    print(s[:k-1]+"c"+s[k:])

Solution (Python):
n,m = list(map(int,input().split()))
line = input()

line2 = line.lower()

for idx,string in enumerate(line):
  if idx+1 == m:
    print(line2[idx],end="")
  else:
    print(line[idx],end="")

Solution (Python):
n, k = map(int, input().split())
S = input()
for i, s in enumerate(S):
    if k - 1 == i:
        if s == 'A':
            print('a', end='')
        elif s == 'B':
            print('b', end='')
        if s == 'C':
            print('c', end='')
    else:
        print(s, end='')

Solution (Python):
import sys,collections as cl,bisect as bs
Max = sys.maxsize
def l():
	return list(map(int,input().split()))
def m():
	return map(int,input().split())
def s(x):
	a = []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x):
	return " ".join(map(str,x))

n,m = m()
a = list(input())

if a[m-1] == "A":
	a[m-1] = "a"
elif a[m-1] == "B":
	a[m-1] = "b"
else:
	a[m-1] = "c"
print("".join(a))

Solution (Python):




n, k = map(int,input().split())
s = input()
ans = ""

for i in range(n):
    if i == k - 1:
        if s[i] == "A":
            ans += "a"
        elif s[i] == "B":
            ans += "b"
        else:
            ans += "c"
    else:
        ans += s[i]


print(ans)

Solution (Python):



def solve():
    n, k = map(int, input().split())
    s = input()
    print(s[:k - 1] + s[k - 1].lower() + s[k:])

if __name__=="__main__":
    solve()

Solution (Python):
N, K = map(int, input().split())
K -= 1
S = input()

print(S[:K] + S[K].lower() + S[K+1:])

Solution (Python):

n, k = map(int, input().split())
s = input()
ans = ''
for i in range(n):
    if i+1 == k:
        ans += s[i].lower()
    else:
        ans += s[i]
print(ans)

Solution (Python):
n, k = map(int, input().split())
a = list(input())
a[k-1] = a[k - 1].lower()
print("".join(a))

Solution (Python):
A, B = (int(i) for i in input().split())
S = input()

s = ""
for i in range(A):
    if i != B - 1:
        s = s + S[i]
    else:
        s = s + S[i].lower()

print(s)

Solution (Python):


from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if (self.parent[i] == i):
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if i < j:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)





def main():
    n, k = intin()
    s = input()

    stdout.write(s[:(k-1)])

    if s[k-1] == 'A':
        stdout.write('a')
    if s[k-1] == 'B':
        stdout.write('b')
    if s[k-1] == 'C':
        stdout.write('c')

    print(s[(k):])


if __name__ == '__main__':
    main()

Solution (Python):



NK = input().split(' ')
N = int(NK[0])
K = int(NK[1])
S = input()

S = S[:K - 1] + S[K - 1].lower() + S[K:]
print(S)

Solution (Python):
n, k = map(int, input().split())
s = input().rstrip()

s = s[:k - 1] + s[k - 1].lower() + s[k:]
print(s)

Solution (Python):
a,b=map(int,input().split())
s=list(input())
s[b-1]=s[b-1].lower()
print("".join(s))

Solution (Python):
s = input().split(" ")
s = [int(s[i]) for i in range(len(s))]
N = s[0]
K = s[1]
s = input()
s = s[:K-1] +  s[K - 1].lower() + s[K : ]
print(s)

Solution (Python):
n,k=map(int,input().split())
s=input()
print(s[:(k-1)]+s[k-1].lower()+s[k:])

Solution (Python):
n, k = map(int, input().split())
s = input()

print(s[: k - 1] + s[k - 1].lower() + s[k:])

Solution (Python):
N, K = map(int, input().split())
S = input()
print(S[0:K-1] + S[K-1].lower() + S[K:])

Solution (Python):
n, k = [int(i) for i in input().split()]
S = input()
k -= 1

print(S[:k] + S[k].lower() + S[k + 1:])

Solution (Python):
list=input().split(" ")
n=int(list[0])
x=int(list[1])
moji=input()
if moji[x-1]=='A':
    ko='a'
elif moji[x-1]=='B':
    ko='b'
else:
    ko='c'

moji=moji[:x-1]+ko+moji[x:]
print(moji)

Solution (Python):
n,m = list(map(int,input().split()))
line = input()

line2 = line.lower()

for idx,string in enumerate(line):
  if idx+1 == m:
    print(line2[idx],end="")
  else:
    print(line[idx],end="")

Solution (Python):
from sys import stdin
N, K = [int(_) for _ in stdin.readline().rstrip().split()]
K = K-1
S = stdin.readline().rstrip()
print(S[0:K]+S[K].lower()+S[K+1:])

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

def main():
    N, K = LI()
    S = SI()
    ans = S[:K-1] + S[K-1].lower() + S[K:]
    return ans

print(main())

Solution (Python):
def main():
    N, K = map(int, input().split())
    S = input()
    ans = S[:K-1] + S[K-1].lower() + S[K:]
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
a, b = (int(_) for _ in input().split())  
x = list(input())
x[b-1] = x[b-1].lower()
[print(i,end = "") for i in x]
print("")

Solution (Python):
n, k = [int(item) for item in input().split()]
s = list(input())
s[k - 1] = s[k - 1].lower()

print(''.join(s))

Solution (Python):
n,k=map(int,input().split())
s=list(input())
if s[k-1]=="A":
    s[k-1]="a"
if s[k-1]=="B":
    s[k-1]="b"
if s[k-1]=="C":
    s[k-1]="c"
print("".join(s))

Solution (Python):

import sys


def solve(N: int, K: int, S: str):
    print(S[:K-1] + S[K-1].lower() + S[K:])
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    S = next(tokens)  
    solve(N, K, S)

if __name__ == '__main__':
    main()

Solution (Python):
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int, ss_raw()))

INF = 1<<29
N,K = ints_raw()
S = input()

def main():
    ans =""
    for i in range(N):
        ans += S[i] if i!= K-1 else S[i].lower()
    return ans

print(main())

Solution (Python):
n,k = map(int,input().split())
s = list(input())

s[k-1] = s[k-1].lower()
print(''.join(s))

Solution (Python):

N,K=map(int,input().split())
S=list(str(input()))
s=S[K-1]
s=s.lower()
S[K-1]=s
print("".join(S))

Solution (Python):
N,K=map(int,input().split())
S=input()

ans=''
for i in range(N):
    if i==K-1:
        a=S[i].lower()
        ans=ans+a
    else:
        a=S[i]
        ans=ans+a
print(ans)

Solution (Python):
n,m=map(int,input().split())
s=input()
print(s[:m-1]+s[m-1].lower()+s[m:])

Solution (Python):
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsm = lambda: map(str, sys.stdin.readline().split())

n, k = nm()
s = ns()
print(s[:k - 1] + s[k - 1].lower() + s[k:])

Solution (Python):

import sys
INF = float("inf")


def solve(N: int, K: int, S: str):
    A = S[:K-1] + S[K-1].lower() + S[K:]
    print(A)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    S = next(tokens)  
    solve(N, K, S)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N, K = map(int, input().split())
    S = input()

    S = list(S)
    if S[K-1] == 'A':
        S[K-1] = 'a'
    elif S[K-1] == 'B':
        S[K-1] = 'b'
    elif S[K-1] == 'C':
        S[K-1] = 'c'

    print(''.join(S))

main()

Solution (Python):
n, k = map(int, input().split())
s = input()

s_k = s[k-1]
print(s[:k-1] + s_k.lower() + s[k:])

Solution (Python):
N,K = map(int,input().split())
S = list(input())

S[K-1] = S[K-1].lower()
print("".join(S))

Solution (Python):
n,k=map(int, input().split()) 
s=[x for x in input()]
if s[k-1]=='A':
    s[k-1]='a'
elif s[k-1]=='B':
    s[k-1]='b'
else:
    s[k-1]='c'
print(''.join(s))

Solution (Python):

N, K = map(int, input().split())


S = input()

res = ""
for i, s in enumerate(S):
    if i + 1 == K:
        res += str.lower(s)
    else:
        res += s
print(res)

Solution (Python):

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

Solution (Python):
N, K = map(int, input().split())
S = input()
K -= 1
ans = S[:K]
if S[K] == 'A':
    ans += 'a'
elif S[K] == 'B':
    ans += 'b'
else:
    ans += 'c'
ans += S[K+1:]
print(ans)

Solution (Python):
N,K=map(int,input().split())
S=list(input())
if S[K-1]=="A":
    S[K-1]="a"
elif S[K-1]=="B":
    S[K-1]="b"
elif S[K-1]=="C":
    S[K-1]="c"
print("".join(S))

Solution (Python):
N,K = map(int,input().split())
s = input()

answer = s[:K-1] + s[K-1].lower() + s[K:]
print(answer)

Solution (Python):
n,k=[int(i) for i in input().split()]
s=input()
print(s[0:k-1]+s[k-1].lower()+s[k:])

Solution (Python):
a,b=input().split()
a=int(a)
b=int(b)
c=input()
count=0
for i in c:
    count+=1
    if count==b:
        print(i.lower(),end="")
    else:
        print(i,end="")

Solution (Python):
n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Solution (Python):
n, k = map(int, input().split())
s = input().strip()

for i, _s in enumerate(s):
  if i+1 == k:
    print(_s.lower(), end='')
  else:
    print(_s, end='')
print()

Solution (Python):
[n,k] = [int(i) for i in input().split()]
s = input()
s = s[:k-1] + s[k-1].lower()+s[k:]
print(s)

Solution (Python):
N, K = [int(elm) for elm in input().split(" ")] 
S = list(input())

S[K-1] = S[K-1].lower()
out = "".join(S)
print(out)

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, K, S):
    S = [c for c in S]
    K -= 1
    if S[K] == 'A':
        S[K] = 'a'
    elif S[K] == 'B':
        S[K] = 'b'
    elif S[K] == 'C':
        S[K] = 'c'
    return ''.join(S)


def main():
    
    N, K = read_int_n()
    S = read_str()
    print(slv(N, K, S))


if __name__ == '__main__':
    main()

Solution (Python):



N,K=[int(c) for c in input().split()]
S=input()
K-=1
if(S[K]=="A"):
	print(S[:K]+"a"+S[K+1:])
if(S[K]=="B"):
	print(S[:K]+"b"+S[K+1:])
if(S[K]=="C"):
	print(S[:K]+"c"+S[K+1:])

Solution (Python):
n, k = map(int, input().split())

s = str(input())

ans = s[0:k-1] + s[k-1].lower() + s[k:n]
print(ans)

Solution (Python):
n,k=map(int,input().split())
s=list(input())
if s[k-1]=="A":
    s[k-1]="a"
if s[k-1]=="B":
    s[k-1]="b"
if s[k-1]=="C":
    s[k-1]="c"
print("".join(s))

Solution (Python):
n,k=map(int,input().split())
s=list(str(input()))

s[k-1]=str.lower(s[k-1])
print("".join(s))

Solution (Python):
def solve(string):
    n, k, s = string.split()
    n, k = int(n), int(k) - 1
    return s[:k] + s[k].lower() + s[k + 1:]


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

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

Solution (Python):
n, k = map(int, input().split())
s = input()
s = s[:k - 1] + s[k - 1].lower() + s[k:]
print(s)

Solution (Python):
N,K = map(int,input().split())
S = list(input())

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

print(''.join(S))

Solution (Python):
N, K = map(int, input().split())
S = list(input())
rule = {'A': 'a', 'B': 'b', 'C': 'c'}
S[K - 1] = rule[S[K - 1]]
print(''.join(S))

Solution (Python):
n, k = map(int, input().split(' '))
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Solution (Python):
N,K=map(int,input().split())
S=input()
dict={"A":"a","B":"b","C":"c"}
s=""
for i in range(N):
    if i+1==K:
        s+=dict[S[i]]
    else:
        s+=S[i]
print(s)

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

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

Solution (Python):
n,k = map(int, input().split())
s = input()

print(s[:k-1]+s[k-1].lower()+s[k:])

Solution (Python):
N, K = list(map(int, input().split()))
s = input()

for i in range(N):
    if i == K-1:
        if s[i] == 'A':
            print('a', end='')
        elif s[i] == 'B':
            print('b', end='')
        else:
            print('c', end='')
    else:
        print(s[i], end='')

Solution (Python):
N, K = map(int,input().split())
S = input()

if K-1 != 0:
  print(S[:K-1] + S[K-1].lower() + S[K:])
else:
  print(S[K-1].lower() + S[K:])