def main():
    n,k = map(int, input().split())
    k-=1
    s = list(input().rstrip())

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


if __name__ == '__main__':
    main() def main():
    n,k = map(int, input().split())
    k-=1
    s = list(input().rstrip())

    s[k]=s[k].lower()
    print(''.join(s)) main n,k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k k-=1 k 1 s = list(input().rstrip()) s list(input().rstrip()) list input().rstrip() ().rstrip () input rstrip 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 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n,k = map(int, input().split())
    k-=1
    s = list(input().rstrip())

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

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

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


if __name__ == '__main__':
    main()
