import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    N, K = map(int, readline().split())
    K -= 1
    S = readline().strip()
    
    S = list(S)
    S[K] = S[K].lower()
    print(''.join(S))
    return


if __name__ == '__main__':
    main() import sys sys read = sys.stdin.read read sys.stdin.read sys.stdin sys stdin read readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline readlines = sys.stdin.readlines readlines sys.stdin.readlines sys.stdin sys stdin readlines sys.setrecursionlimit(10 ** 9) sys.setrecursionlimit sys setrecursionlimit 10 ** 9 10 9 INF = 1 << 60 INF 1 << 60 1 60 def main():
    N, K = map(int, readline().split())
    K -= 1
    S = readline().strip()
    
    S = list(S)
    S[K] = S[K].lower()
    print(''.join(S))
    return main N, K = map(int, readline().split()) N map(int, readline().split()) map int readline().split() ().split () readline split K K -= 1 K 1 S = readline().strip() S readline().strip() ().strip () readline strip S = list(S) S list(S) list S S[K] = S[K].lower() S[K] S K S[K].lower() [K].lower [K] S K lower print(''.join(S)) print ''.join(S) ''.join '' join S return if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N, K = map(int, readline().split())
    K -= 1
    S = readline().strip()
    
    S = list(S)
    S[K] = S[K].lower()
    print(''.join(S))
    return def main():
    N, K = map(int, readline().split())
    K -= 1
    S = readline().strip()
    
    S = list(S)
    S[K] = S[K].lower()
    print(''.join(S))
    return main readlines = sys.stdin.readlines sys.stdin.readlines readlines INF = 1 << 60 1 << 60 INF read = sys.stdin.read sys.stdin.read read readline = sys.stdin.readline sys.stdin.readline readline
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    N, K = map(int, readline().split())
    K -= 1
    S = readline().strip()
    
    S = list(S)
    S[K] = S[K].lower()
    print(''.join(S))
    return


if __name__ == '__main__':
    main()
