def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, k = Input()
    s = input()
    print("".join(ch.lower() if index==k else ch for index, ch in enumerate(s, 1)))


main() def mapt(fn, *args):
    return tuple(map(fn, *args)) mapt return tuple(map(fn, *args)) tuple(map(fn, *args)) tuple map(fn, *args) map fn *args args fn fn *args def Input():
    return mapt(int, input().split(" ")) Input return mapt(int, input().split(" ")) mapt(int, input().split(" ")) mapt int input().split(" ") ().split () input split " " def main():
    n, k = Input()
    s = input()
    print("".join(ch.lower() if index==k else ch for index, ch in enumerate(s, 1))) main n, k = Input() n Input() Input k s = input() s input() input print("".join(ch.lower() if index==k else ch for index, ch in enumerate(s, 1))) print "".join(ch.lower() if index==k else ch for index, ch in enumerate(s, 1)) "".join "" join ch.lower() if index==k else ch index==k index k ch.lower() ch.lower ch lower ch main() main def Input():
    return mapt(int, input().split(" ")) def Input():
    return mapt(int, input().split(" ")) Input def main():
    n, k = Input()
    s = input()
    print("".join(ch.lower() if index==k else ch for index, ch in enumerate(s, 1))) def main():
    n, k = Input()
    s = input()
    print("".join(ch.lower() if index==k else ch for index, ch in enumerate(s, 1))) main def mapt(fn, *args):
    return tuple(map(fn, *args)) def mapt(fn, *args):
    return tuple(map(fn, *args)) mapt
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n, k = Input()
    s = input()
    print("".join(ch.lower() if index==k else ch for index, ch in enumerate(s, 1)))


main()