import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    n, k = inl()
    s = list(ins())
    s[k - 1] = s[k - 1].lower()
    return "".join(s)


print(solve()) import sys sys sys.setrecursionlimit(10 ** 8) sys.setrecursionlimit sys setrecursionlimit 10 ** 8 10 8 ini = lambda: int(sys.stdin.readline()) ini lambda: int(sys.stdin.readline()) int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline int(x) for x in sys.stdin.readline().split() for x in sys.stdin.readline().split() x sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split for x in sys.stdin.readline().split() int(x) int x inl = lambda: [int(x) for x in sys.stdin.readline().split()] inl lambda: [int(x) for x in sys.stdin.readline().split()] [int(x) for x in sys.stdin.readline().split()] ins = lambda: sys.stdin.readline().rstrip() ins lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) debug lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) print "\033[33m" *a a "\033[0m" **dict(file=sys.stderr, **kw) dict(file=sys.stderr, **kw) dict file=sys.stderr file sys.stderr sys stderr **kw kw *a **kw def solve():
    n, k = inl()
    s = list(ins())
    s[k - 1] = s[k - 1].lower()
    return "".join(s) solve n, k = inl() n inl() inl k s = list(ins()) s list(ins()) list ins() ins s[k - 1] = s[k - 1].lower() s[k - 1] s k - 1 k 1 s[k - 1].lower() [k - 1].lower [k - 1] s k - 1 k 1 lower return "".join(s) "".join(s) "".join "" join s print(solve()) print solve() solve ins = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() ins inl = lambda: [int(x) for x in sys.stdin.readline().split()] lambda: [int(x) for x in sys.stdin.readline().split()] inl ini = lambda: int(sys.stdin.readline()) lambda: int(sys.stdin.readline()) ini def solve():
    n, k = inl()
    s = list(ins())
    s[k - 1] = s[k - 1].lower()
    return "".join(s) def solve():
    n, k = inl()
    s = list(ins())
    s[k - 1] = s[k - 1].lower()
    return "".join(s) solve debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) debug
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    n, k = inl()
    s = list(ins())
    s[k - 1] = s[k - 1].lower()
    return "".join(s)


print(solve())
