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 sys  import stdin,stdout

import bisect

import math

def st():
    return list(stdin.readline().strip())

def inp():
    return int(stdin.readline())

def li():
    return list(map(int,stdin.readline().split()))

def mp():
    return map(int,stdin.readline().split())

def pr(n):
    stdout.write(str(n)+"\n")

def soe(limit):
    l=[1]*(limit+1)
    prime=[]
    for i in range(2,limit+1):
        if l[i]:
            for j in range(i*i,limit+1,i):
                l[j]=0

    for i in range(2,limit+1):
        if l[i]:
            prime.append(i)
    return prime

def segsoe(low,high):
    limit=int(high**0.5)+1
    prime=soe(limit)
    n=high-low+1
    l=[0]*(n+1)
    for i in range(len(prime)):
        lowlimit=(low//prime[i])*prime[i]
        if lowlimit<low:
            lowlimit+=prime[i]
        if lowlimit==prime[i]:
            lowlimit+=prime[i]
        for j in range(lowlimit,high+1,prime[i]):
            l[j-low]=1
    for i in range(low,high+1):
        if not l[i-low]:
            if i!=1:
                print(i)
                
def gcd(a,b):
    while b:
        a=a%b
        b,a=a,b
    return a

def power(a,n):
    r=1
    while n:
        if n&1:
            r=(r*a)
        a*=a
        n=n>>1
    return r
    
def solve():
    n,k=mp()
    s=input()
    for i in range(n):
        if i==k-1:
            print(s[i].lower(),end="")
        else:
            print(s[i],end="")
        
    



for _ in range(1):
    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=map(int,input().split());s=input();print(*[s[i] if k-1!=i else s[i].lower() for i in range(n)],sep='')

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

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

Solution (Python):
n,k=[int(s) for s in input().split()]
s=input()

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

Solution (Python):
a = [int(s) for s in input().split()]
b = input()
c = list(b)
c[a[1] - 1] = c[a[1] - 1].lower()
print(''.join(c))

Solution (Python):

import os
import sys
from io import BytesIO, IOBase




BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")


class union_find:
    def __init__(self, n):
        self.n = n
        self.rank = [0]*n
        self.parent = [int(j) for j in range(n)]
    
    def union(self,i,j):
        i = self.find(i)
        j = self.find(j)
        if self.rank[i] == self.rank[j]:
            self.parent[i] = j
            self.rank[j] += 1

        elif self.rank[i] > self.rank[j]:
            self.parent[j] = i
        else:
            self.parent[i] = j

    def find(self, i):
        temp = i
        if self.parent[temp] != temp:
            self.parent[temp] = self.find(self.parent[temp])
        return self.parent[temp]
def main():

    n,k = [int(j) for j in input().split()]
    s = list(input())
    s[k-1] = s[k-1].lower()
    print("".join(s))
        





        
                
            
        


        
        




        




if __name__ == "__main__":
    main()

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()
newS = S[:K-1]+S[K-1].lower()+S[K:]
print(newS)

Solution (Python):
N,K=map(int,input().split())
S=input()
ans=""
for x in range(N):
  if x!=K-1:
    ans+=S[x]
  else:
    if S[x]=="A":
      ans+="a"
    elif S[x]=="B":
      ans+="b"
    elif S[x]=="C":
      ans+="c"
print(ans)

Solution (Python):








































global FLAG_LOG
FLAG_LOG = False


def log(value):
    
    
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    S = lines[1]
    
    N, K = list(map(int, lines[0].split()))
    
    
    
    
    
    
    
    

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

    result = S[:K-1] + char + S[K:]

    return [result]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3 1', 'ABC']
        lines_export = ['aBC']
    if pattern == 2:
        lines_input = ['4 3', 'CABA']
        lines_export = ['CAbA']
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

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

Solution (Python):


def main():

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

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

    ans = ''.join(ans)

    print(ans)


if __name__ == "__main__":
    main()

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()

Sstr = list(S)
Sstr[K-1] = Sstr[K-1].lower()
S2 = ''.join(Sstr)

print(S2)

Solution (Python):
N, K = (int(x) for x in 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 = input()

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

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()

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

print(ans)

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

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

print(*arr, sep='')

Solution (Python):
A=list(map(int,input().split()))
S=input()
K=A[1]
s=S[K-1]
s=s.lower()
print(S[:K-1]+s+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"
    print("".join(s))
elif s[k-1] == "B":
    s[k-1] = "b"
    print("".join(s))
elif s[k-1] == "C":
    s[k-1] = "c"
    print("".join(s))

Solution (Python):
_,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()
c=""
for i in range(n):
  if i==k-1:
    c+=s[i].lower()
  else:
    c+=s[i]
print(c);

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

print(S[:K-1], end='')

if K == N:
    print(S[K-1].lower())
else:
    print(S[K-1].lower(), end='')
    print(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 = 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()
S="".join(S)
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()
s = s[0: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())
k -= 1
s = input()
print(s[:k]+s[k].lower()+s[k+1:])

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

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

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

def main(n,k,s):
    ans=s[:k-1]+s[k-1].lower()+s[k:]
    return ans

if __name__=='__main__':
    n,k,s=readinput()
    ans=main(n,k,s)
    print(ans)

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

lists = []
for i in range(0, n, 1):
  if i+1 == k:
    lists.append(s[i].lower())
  else:
    lists.append(s[i])

print(''.join(lists))

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()
S_list = list(S)
K -= 1
answer = ""
S_list[K] = S_list[K].swapcase()

for x in S_list:
    answer += x
print(answer)

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

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

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

Solution (Python):
n,k=(int(x) for x in input().split())
s=list(input()) 
for i in range(n):
    if i==k-1:
        s[i]=s[i].lower()
str_s="".join(s)
print(str_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,b=map(int,input().split())
s=input()
inter = s[b-1]
inter_new = inter.lower()
res = ""
if b ==1:
  res = inter_new+s[1:len(s)]
elif b == a:
  res = s[0:len(s)-1]+inter_new
else:
  res = s[0:b-1]+inter_new+s[b:len(s)]
print(res)

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()
print(f"{s[:k-1]}{s[k-1].lower()}{s[k:]}")

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

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

if not ( 1 <= N <= 50 and 1 <= K <= N ): sys.exit()
if len(re.findall(r'[^(A|B|C)]',S)) != 0 : print("NG");sys.exit()

res = []
for I in range(len(list(S))):
    res.append(S[I]) if I + 1 != K else res.append(S[I].lower())
print(''.join(res))

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):
N,K=list(map(int,input().split()))
S=input()
sdic={"A":"a","B":"b","C":"c"}
print(S[:K-1]+sdic[S[K-1]]+S[K:])

Solution (Python):
(a,b)=list(map(int, input().split()))
s=input()
print(''.join([c if i!=b-1 else c.lower() for i,c in enumerate(s)]))

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

Solution (Python):
def main():
    n,k = map(int,input().split())
    s = list(input())
    s[k - 1] = chr(ord(s[k - 1]) + 32)
    t = ''
    for i in s:
        t = t + i
    print(t)
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(input())
 
S[K-1]=S[K-1].lower()
print("".join(S))

Solution (Python):
import sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  
def LS2(): return list(sys.stdin.readline().rstrip())  

N,K = LI()
S = LS2()

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

print(''.join(S))

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, K = map(int, readline().split())
S = list(read().rstrip().decode())

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=map(int,input().split())
K-=1
S=input()
S=S[:K]+S[K].lower()+S[K+1:]
print(S)

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

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

first = s[:k-1]
mid = s[k-1].lower()
last = s[k:]

print( first + mid + last )

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

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

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

Solution (Python):
data=input().split()
N=int(data[0])
K=int(data[1])
S=input()
s=list(S)
s[K-1]=S[K-1].lower()
print("".join(s))

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

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

def main():
    n, k = map(int, input().split())
    s = list(input())
    s[k-1] = s[k-1].lower()
    print(*s, sep='')
    
if __name__ == '__main__':
    main()

Solution (Python):


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

kmj = chr(ord(S[K-1])+32)

T = ""
for i in range(N):
    if i == K-1:
        T+=kmj
    else :
        T+=S[i]

print(T)

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())

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

for i in s:
    print(i,end = "")

Solution (Python):
n, k = map(int, input().split())
s = input()
t = ''
for i in range(n):
  if i == k-1:
    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):
a, b = map(int, input().split())
c = input()

print(c[:b-1]+c[b-1].lower()+c[b:])

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

for i in range(len(S)):
    if i != K-1:
        print(S[i],end='')
    else:
        print(chr(ord(S[i])+32),end="")

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 = [int(_) for _ 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())
S[K-1] = S[K-1].lower()
print("".join(S))

Solution (Python):
N,K = (int(x) for x in input().split())
S = list(input())
S[K-1] = S[K-1].swapcase()
print(''.join(S))

Solution (Python):
n,k=map(int,input().split())
s=input()
x=["a","b","c"]
y=[0]*n
for i in range(n):
  y[i]=s[i]
  if s[k-1]=="A":
    y[k-1]="a"
    
  elif s[k-1]=="B":
    y[k-1]="b"
    
  elif s[k-1]=="C":
    y[k-1]="c"
    

print("".join(y))

Solution (Python):
import sys
rr = lambda: sys.stdin.readline().rstrip()
rm = lambda: map(int, sys.stdin.buffer.readline().split())
a, b = rm()
s = rr()
print(s[:b-1] + s[b-1].lower() + s[b:])

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b = rm()
s = rr()
print(s[:b-1] + s[b-1].lower() + s[b:])

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"
S="".join(S)
print(S)

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()
s=str.lower(S[k-1])
ans=S[:k-1]+s+S[k:]
print(ans)

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

main()

Solution (Python):
N, K = map(int, input().split())
s3 =[]

s = list(input())

s1 = s


s2= s1[K-1]

s3 = s2.lower()

s1[K-1] = s3

print('' .join(s1))

Solution (Python):
a,b=map(int,input().split())
s=list(input())
wd=''
cnt=1
for i in s:
    if cnt==b:
        cnt+=1
        wd+=(i.lower())
    else:
        cnt+=1
        wd+=(i)
print(wd)

Solution (Python):
N=input("")
N=N.split(" ")
K=int(N[1])
N=N[0]
s=str(input(""))
print(s[0:K-1]+s[K-1].lower()+s[K:])

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

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())

if s[k-1].isupper():
    s[k-1] = s[k-1].lower()
else:
    s[k-1] = s[k-1].upper()

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()
a = ''
for i in range(n):
    if i == k-1:
        a += s[i].lower()
    else:
        a += s[i]
print(a)

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
from decimal import Decimal
from operator import mul

INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)



class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def combinations_count(n, r):
    if n < r:
        return 0
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


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()
s_s = s[:k-1]
s_l = s[k-1].lower()
s_e = s[k:]
print(s_s+s_l+s_e)

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

before = s[0:k-1]
low = s[k-1]
low = low.lower()
after = s[k:]

print(before+low+after)

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 = input().split()
k = int(k)
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):
a, b = map(int, input().split()) 
c = input()
d = c[:b-1] + c[b-1].lower() + c[b:]
print(str(d))

Solution (Python):

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

Solution (Python):
n,k=tuple(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 = 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'
else:
    s[k-1] = 'c'

print(''.join(s))

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

temp = s[k-1]
if temp == "A":
    s[k-1] = "a"
elif temp == "B":
    s[k-1] = "b"
else:
    s[k-1] = "c"

print(''.join(s))

Solution (Python):
change_K = int(input().split(" ")[-1])
word_S = list(input())
S = list(word_S)
word1 = ""
for i in range(change_K - 1):
    word1 = word1 + S[i]
word2 = S[change_K - 1]
word3 = ""
count = 0
while True:
    try:
        word3 = word3 + S[change_K + count]
        count += 1
    except IndexError:
        break
word2 = word2.swapcase()
print(word1 + word2 + word3)

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

S = input()
ans = ""

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

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**7) 
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right

from collections import deque


from collections import Counter

from itertools import accumulate,combinations,permutations

from heapq import heapify,heappop,heappush


from functools import lru_cache

from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    

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

    s=list(input())
    s[K-1]=s[K-1].lower()
    print(*s,sep="")





if __name__ == "__main__":
    main()

Solution (Python):
k,s=open(0)
k=int(k[2:])
print(s[:k-1]+s[k-1].lower()+s[k:])

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

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

Solution (Python):
n, k = map(int, 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):
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())

if s[k-1]=="A":
    s[k-1]=s[k-1].lower()
elif s[k-1]=="B":
    s[k-1]=s[k-1].lower()
elif s[k-1]=="C":
    s[k-1]=s[k-1].lower()

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

Solution (Python):


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

s[k - 1] = s[k - 1].lower()

print(*s, sep='')

Solution (Python):
n,k = map(int,input().split())
s = input()
k -= 1
ans = ''
for i in range(n):
    if i == k:
      if s[k] == 'A': ans += 'a'
      elif s[k] == 'B': ans += 'b'
      else: ans += 'c'
    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"
for i in range(n):
  print(S[i],end='')

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[K-1] = S[K-1].lower()

print("".join(S), end='')

Solution (Python):
n, k = [int(v) for v in input().split()]
s = list(input())
print('{}{}{}'.format(''.join(s[:k-1]), s[k-1].lower(), ''.join(s[k:])))

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)



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







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

print(s)

Solution (Python):
N, K = map(int, input().split())
S = list(input())
S[K-1] = S[K-1].lower()
for i in S:
    print(i, end="")

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

s[k-1] = s[k-1].lower()
ans = ''.join(s)
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=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):
_, k = [int(i) - 1 for i in input().split()]
s = input()
print(s[:k] + s[k].lower() + s[k + 1:])

Solution (Python):
def INT():
    return int(input())

def MI():
    return map(int, input().split())

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

N, K = MI()
S = input()
T = S.lower()
S = list(S)
T = list(T)

S[K - 1] = T[K - 1]

print("".join(map(str, S)))

Solution (Python):
N, K = map(int, input().split())
S = list(input())
S[K-1] = S[K-1].lower()
for i in S:
    print(i, end="")

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

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