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:]) n,k=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k s=input() s input() 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:]) n==1 n 1 print(s.lower()) print s.lower() s.lower s lower elif k==1:
  print(s[0].lower()+s[1:]) k==1 k 1 print(s[0].lower()+s[1:]) print s[0].lower()+s[1:] s[0].lower() [0].lower [0] s 0 lower s[1:] s 1: 1 elif k==n:
  print(s[:n-1]+s[n-1].lower()) k==n k n print(s[:n-1]+s[n-1].lower()) print s[:n-1]+s[n-1].lower() s[:n-1] s :n-1 n-1 n 1 s[n-1].lower() [n-1].lower [n-1] s n-1 n 1 lower print(s[:k-1]+s[k-1].lower()+s[k:]) print s[:k-1]+s[k-1].lower()+s[k:] s[:k-1]+s[k-1].lower() s[:k-1] s :k-1 k-1 k 1 s[k-1].lower() [k-1].lower [k-1] s k-1 k 1 lower s[k:] s k: k k=map(int,input().split()) map(int,input().split()) k n,k=map(int,input().split()) map(int,input().split()) n s=input() input() s
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:])