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:
#!/usr/bin/env pypy3

#import numpy as np
#import scipy, scipy.special

# Python 3 modules: https://docs.python.org/3/library/

import math, itertools, operator
from math import *
from math import factorial as fact
from itertools import permutations, combinations
from functools import reduce
# Use scipy for stats: https://docs.scipy.org/doc/scipy/reference/stats.html
# Before Python 3.5
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)

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=[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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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(*s,sep="")

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inp = input().split()
n = int(inp[0])
k = int(inp[1])
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())
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, 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:])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019/05/19
# AtCoder Beginner Contest 126 - A

# Input
n, k = map(int,input().split())
s = input()
ans = ""
# Calc
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]

# Output
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

if __name__=="__main__":
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env 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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
###############################################################################

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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)

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
n, k = [int(i) for i in input().split()]
S = input()
k -= 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, k = [int(item) for item in 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"
if s[k-1]=="B":
    s[k-1]="b"
if s[k-1]=="C":
    s[k-1]="c"
print("".join(s))

Submission status: Accepted

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


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


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, K, S)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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))  # type: int
    K = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, K, S)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# N = int(input())
N, K = map(int, input().split())
# A = list(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)

Submission status: Accepted

Solution code:
#coding: utf-8
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()
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)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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 = read_int()
    N, K = read_int_n()
    S = read_str()
    print(slv(N, K, S))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:



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:])

Submission status: Accepted

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

s = str(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

"""                         
Beautiful is better than ugly.
    Explicit is better than implicit.
Simple is better than complex.
    Complex is better than complicated.
Flat is better than nested.
    Sparse is better than dense.
                    
    * Readability counts *

 // Author : raj1307 - Raj Singh
 // Date   : 19.05.19

"""

from __future__ import division, print_function
import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    _str = str
    str = lambda x=b"": x if type(x) is bytes else _str(x).encode()

def ii(): return int(input())
def si(): return input()
def mi(): return map(int,input().strip().split(" "))
def li(): return list(mi())

def dmain():
    sys.setrecursionlimit(100000000)
    threading.stack_size(40960000)
    thread = threading.Thread(target=main)
    thread.start()
    
#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import ceil,floor,log,sqrt,factorial,pow,pi
#from bisect import bisect_left,bisect_right
#from decimal import *,threading

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod,MOD=1000000007,998244353
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[0] 
def sort2(l):return sorted(l, key=getKey)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p1
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x
    
def isPrime(n) : # Check Prime Number or not 
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) : 
        if (n % i == 0 or n % (i + 2) == 0) : 
            return False
        i = i + 6
    return True


# For getting input from input.txt file 
#sys.stdin = open('input.txt', 'r')  
  
# Printing the Output to output.txt file 
#sys.stdout = open('output.txt', 'w') 

def main():
    
    
    n,m=mi()
    s=si()
    for i in range(n):
        if i==m-1:
            print(s[i].lower(),end='')
        else:
            print(s[i],end='')
    




# region fastio

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):
        if self.buffer.tell():
            return self.buffer.read()
        return os.read(self._fd, os.fstat(self._fd).st_size)

    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)


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", b" "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", b"\n"))
    if kwargs.pop("flush", False):
        file.flush()


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

# endregion

if __name__ == "__main__":
    main()
    #dmain()

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'
else:
    t = 'c'

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#	!/usr/bin/env python3
#	encoding: UTF-8
#	Modified: <19/May/2019 05:33:27 PM>


#	✪ H4WK3yE乡
#	Mohd. Farhan Tahir
#	Indian Institute Of Information Technology (IIIT), Gwalior


import sys


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


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


def input(): return sys.stdin.readline().strip()


def main():
    n, k = get_ints()
    s = list(input())
    s[k - 1] = s[k - 1].lower()
    print(*s, sep='')


if __name__ == "__main__":
    main()

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


main()

Submission status: Accepted

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

st = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
N, K = map(int, input().split())
S = input()

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

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

def main():
  N,K=LI()
  s=S()
  print(s[:K-1]+s[K-1].lower()+s[K:])

main()
# print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# リストの3番目の要素を'z'で上書き
str_list[k - 1] = s[k - 1].lower()

# またリストから文字列へ戻す
str_changed = "".join(str_list)
print(str_changed)

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

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 = list(map(int, input().split()))
s = list(input())
d = {"A":"a", "B":"b", "C":"c"}
s[k-1] = d[s[k-1]]
print("".join(s))

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

N,K = inpl()
K -= 1
S = list(input())

if S[K] == 'A':
    S[K] = 'a'
    print(''.join(S))
elif S[K] == 'B':
    S[K] = 'b'
    print(''.join(S))
elif S[K] == 'C':
    S[K] = 'c'
    print(''.join(S))

Submission status: Accepted

Solution code:
_, k = (int(z) for z in input().split())
s = input()
j = k - 1
print(s[:j] + s[j].lower() + s[j + 1:])

Submission status: Accepted

Solution code:
n,k=map(int, input().split())
k -= 1
s = [i for i in input()]

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

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

print()

Submission status: Accepted

Solution code:

N,K=list(map(int,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:])
elif S[K-1]=="C":
    print(S[:K-1]+"c"+S[K:])