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



Sample input:
3 1
ABC


Sample output:
aBC

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    N, K = map(int, input().split())
    S = list(input().rstrip())
    S[K-1] = S[K-1].lower()
    print("".join(S))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed May 13 12:28:04 2020

@author: shinba
"""


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

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

print("".join(s))

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
s = input()
sl = []
for i in range(len(s)):
    sl.append(s[i])

Al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
al = 'abcdefghijklmnopqrstuvwxyz'

for i in range(len(Al)):
    if sl[k-1] == Al[i]:
        sl[k-1] = (al[i])


print(''.join(sl))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import math
import bisect

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

Submission status: Accepted

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

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

print(''.join(s))

Submission status: Accepted

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

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

Submission status: Accepted

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

S=list(s)
a=S[k-1]
b=a.lower()
S[k-1]=b

print(*S,sep='')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
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

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

#############
# Main Code #
#############

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


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


print("".join(S))

Submission status: Accepted

Solution code:
import sys
import math
sys.setrecursionlimit(10**6)
from collections import defaultdict

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

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

K -= 1

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
S = list(map(str, input().rstrip()))

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

print(*S, sep="")

Submission status: Accepted

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

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

print(''.join(s))

Submission status: Accepted

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


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

print(''.join(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n, k = Is()
s = LS()
s[k-1] = s[k-1].lower()
print("".join(s))

Submission status: Accepted

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

    print(S)


if __name__ == '__main__':

    ABC_126_A()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

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

main()

Submission status: Accepted

Solution code:
# A - Changing a Character

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

s = input()

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

s = s[:k-1] + t + s[k:]

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
s=input()
ans=""
for i in range(n):
    a=s[i]
    if i+1==k:
        a=a.swapcase()
    ans+=a
print(ans)

Submission status: Accepted

Solution code:
# A
n, k = map(int, input().split())
s = list(input())
s[k-1] = s[k - 1].lower()
print(*s,sep="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# N = int(input())
# S = input()
N, K = map(int, input().split())
S = [s for s in input()]
# A = list(map(int, input().split()))
S[K - 1] = S[K - 1].lower()
print("".join(S))

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
s = list(input())
s[k - 1] = chr(ord(s[k - 1]) + 32)
print(''.join(s))

Submission status: Accepted

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

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

print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def changing_character(n, k, s):

    s[k-1] = s[k-1].lower()
    return "".join(s)
def main():
    n, k = map(int, input().split())
    s = list(str(input()))
    print(changing_character(n, k, s))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# ABC126A

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def main():
    _, K = map(int, input().split(' '))
    S = input()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(s[:k-1] + chr(ord(s[k-1])+32) + s[k:])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
S = input()
ret = ""
for i,s in enumerate(S):
    if i+1==K:
        ret += str.lower(s)
    else:
        ret += s
print(ret)

Submission status: Accepted

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

k -= 1

for i in range(n):
  print(s[i] if i != k else s[i].lower(), end="")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(''.join(s))

Submission status: Accepted

Solution code:
stdin = open(0).read().split('\n')
N, K = map(int,stdin[0].split())
S = stdin[1]
l=list(S)
l[K-1]=l[K-1].lower()
print("".join(l))

Submission status: Accepted

Solution code:
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'

ans = ''.join(S)
print(ans)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
k = k-1
s = input()

for i in range(n):
  if i != k:
    print(s[i], end="")
  else:
    if s[k] == "A":
      print("a", end="")
    elif s[k] == "B":
      print("b", end="")
    elif s[k] == "C":
      print("c", end="")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

N, K = map(int, input().split())
S = input()
cnt = 0
ans = ""

for i in S:
    if cnt == K-1:
        ans += i.swapcase()
    else:
        ans += i
    cnt += 1

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n,k = map(int, input().split())
S = list(input())
S[k-1]= S[k-1].lower()
print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k =map(int,input().split())
s =str(input())
ans = []
for i in range(n):
    if i == k-1:
        ans.append(s[i].lower())
        
    else:
        ans.append(s[i])

print(''.join(ans))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

S = list(S)

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

print("".join(S))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

print(S[:K-1], end="")
print(chr(ord(S[K-1])+32), end="")
print(S[K:])

Submission status: Accepted

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

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

print(s[:k-1] + t + s[k:])

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
s=input()
t=s.lower()
u=[]
for i in range(len(s)):
    if i==(k-1):
        u.append(t[i])
    else:
        u.append(s[i])
print(*u,sep='')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
n, k = map(int, input().split())
s = input()
for i in range(n):
    print(chr(ord(s[i]) - ord('A') + ord('a')), end='') \
        if i == k - 1 else print(s[i], end='')
print('')

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
s = input()
for i in range(0, k-1):
    print(s[i], end="")
print(str.swapcase(s[k-1]), end="")
for i in range(k, n):
    print(s[i], end="")

Submission status: Accepted

Solution code:
N, K = list(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))

Submission status: Accepted

Solution code:
n,m = map(int,input().split())
s = input()
res = ""
for i in range(n):
  if i == m-1:
    res += s[i].lower()
  else:
    res += s[i]
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
N,K = map(int,input().split())
a = input()
res = ''
S = [el for el in a]
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 el in S:
  res += el
print(res)

Submission status: Accepted

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

print(S[:K - 1] + t + S[K:])

Submission status: Accepted

Solution code:
n, k = map(int, input().split(" "))
s = input()
moji = s[k - 1]
mojia = moji.lower()
res = ""
for i, word in enumerate(s):

    if i == k - 1:
        res = res + mojia
        continue
    res = res + word

print(res)

Submission status: Accepted

Solution code:
n,k = map(int,input().split())
s = str(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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k = [int(i) for i in input().split()]
s = input()
for i, j in enumerate(s):
    if i + 1 == k:
        print(j.lower(),end="")
    else:
        print(j, end="")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
num_str = input().split(" ")
S = input()

N = int(num_str[0])
K = int(num_str[1])
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"

S = "".join(s)
print(S)

Submission status: Accepted

Solution code:

n,k = map(int,input().split())
s = input()
cnt = 0
ans = []
for i in s:
  cnt += 1

  if cnt == k:
    ans.append(i.lower())
  else:
    ans.append(i)
print("".join(ans))

Submission status: Accepted

Solution code:
def q1():
    N, K = (int(i) for i in input().split())
    S = list(input())

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


if __name__ == '__main__':
    q1()

Submission status: Accepted

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

Submission status: Accepted

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

if 2<=k<n:
  print(s[:k-1] + chr(ord(s[k-1])+32) + s[k:n])
elif k==1:
  print(chr(ord(s[0])+32) + s[1:n])
else:
  print(s[:n-1] + chr(ord(s[n-1])+32))

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
s=input()
t="D"
for i in range(0,n):
  if k==1 and i==0:
    if s[k-1]=="A":
      t="a"
    if s[k-1]=="B":
      t="b"
    if s[k-1]=="C":
      t="c"
    moji = t
    continue
  elif i==k-1:
    if s[k-1]=="A":
      t="a"
    if s[k-1]=="B":
      t="b"
    if s[k-1]=="C":
      t="c"
    moji += t
  elif i==0:
    moji=s[0]
    continue
  else:
    moji += s[i]
  
print(moji)

Submission status: Accepted

Solution code:
n, k = [int(x) for x in input().split()]
s_list = list(input())
s_list[k - 1] = s_list[k - 1].lower()
print("".join(s_list))

Submission status: Accepted

Solution code:
x = input().split()
s = input()
n = int(x[0])
k = int(x[1]) - 1
S = ''
for i in  range(0, n):
  if i == k:
    S += s[i].lower()
  else:
    S += s[i]
print(S)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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'

ANS = "".join(S)
print(ANS)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
# import math
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4


def main():
    mod = 1000000007                  # 10^9+7
    inf = float('inf')
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():  return int(input())
    def mi():  return map(int, input().split())
    def mi_0(): return map(lambda x: int(x)-1, input().split())
    def lmi(): return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():  return list(input())
    
    
    n, k = mi()
    s = input()
    print(s[:(k-1)] + s[k-1].lower() + s[k:])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
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"
ans=""
for i in s:
    ans+=i
print(ans)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
s = list(input())
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
b = "abcdefghijklmnopqrstuvwxyz"
for i in range(26):
    if s[k - 1] == a[i]:
        s[k - 1] = b[i]
        break
print(*s, sep="")

Submission status: Accepted

Solution code:
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'
  
ans = ''
for i in range(len(S)):
  ans += S[i]
  
print(ans)

Submission status: Accepted

Solution code:
#copy

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
param = list(map(int, input().split()))
n = param[0]
k = param[1]
s = input()

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

Submission status: Accepted

Solution code:
def main():
    N, K = map(int, input().split())
    S = list(input())
    S[K-1] = S[K-1].lower()
    print("".join(S))
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
s=input()
if s[k-1]=='A':
  x='a'
elif s[k-1]=='B':
  x='b'
elif s[k-1]=='C':
  x='c'
print(s[:k-1]+x+s[k:])

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,K = [int(x) for x in input().split()]

S = list(input())
#print(S)
S[K-1] = chr( ord(S[K-1]) + 32)

for x in S:
    print(x,end='')

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
a=list(str(input()))
a[k-1]=chr(ord(a[k-1])+32)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, k = list(map(int, input().split()))
# r = list(map(int, input().split()))
s = input()

for i in range(n):
    if i == k-1:
        print(s[i].swapcase(), end="")
    else:
        print(s[i], end="")

Submission status: Accepted

Solution code:
N,K=map(int,input().split())
S=str(input())
strings="A","B","C"
S=S[:K-1]+S[K-1].lower()+S[K:]
print(str(S))

Submission status: Accepted

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

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

ans=s[:k-1]+x+s[k:]
print(ans)

Submission status: Accepted

Solution code:
n, k = map(int, input().split())
s = input()
tmp = ord(s[k-1])
tmp1 = (chr(tmp+32))
ans = []

for i in range(len(s)):
    if i == k-1:
        ans.append(tmp1)
    else:
        ans.append(s[i])

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

Submission status: Accepted

Solution code:
n,k=map(int,input().split())
s=input()
s_list=list(s)
for i in range(n):
    if i==k-1:
        if s_list[i]=='A':
            s_list[i]='a'
        elif s_list[i]=='B':
            s_list[i]='b'
        else:
            s_list[i]='c'
print("".join(s_list))