import java.io.*;
import java.util.*;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long K;
        K = sc.nextLong();
        String S;
        S = sc.next();

        final Solver solver = new Solver();
        solver.solve(N, K, S);
    }
}

class Solver {
    public void solve(long N, long K, String S) {
        int target = (int) (K - 1);
        for (int i = 0; i < N; i++) {
            if (i == target) {
                char n = (char) (S.charAt(target) - ('A' - 'a'));
                System.out.print(n);
                continue;
            }
            System.out.print(S.charAt(i));
        }
        System.out.println();
    }
}
 import java.io.*; io.* java import java.util.*; util.* java public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long K;
        K = sc.nextLong();
        String S;
        S = sc.next();

        final Solver solver = new Solver();
        solver.solve(N, K, S);
    }
} Main public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long K;
        K = sc.nextLong();
        String S;
        S = sc.next();

        final Solver solver = new Solver();
        solver.solve(N, K, S);
    } main {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long K;
        K = sc.nextLong();
        String S;
        S = sc.next();

        final Solver solver = new Solver();
        solver.solve(N, K, S);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N; N N = sc.nextLong() N sc.nextLong() sc.nextLong sc long K; K K = sc.nextLong() K sc.nextLong() sc.nextLong sc String S; S S = sc.next() S sc.next() sc.next sc final Solver solver = new Solver(); solver new Solver() solver.solve(N, K, S) solver.solve solver N K S final String[] args args class Solver {
    public void solve(long N, long K, String S) {
        int target = (int) (K - 1);
        for (int i = 0; i < N; i++) {
            if (i == target) {
                char n = (char) (S.charAt(target) - ('A' - 'a'));
                System.out.print(n);
                continue;
            }
            System.out.print(S.charAt(i));
        }
        System.out.println();
    }
} Solver public void solve(long N, long K, String S) {
        int target = (int) (K - 1);
        for (int i = 0; i < N; i++) {
            if (i == target) {
                char n = (char) (S.charAt(target) - ('A' - 'a'));
                System.out.print(n);
                continue;
            }
            System.out.print(S.charAt(i));
        }
        System.out.println();
    } solve {
        int target = (int) (K - 1);
        for (int i = 0; i < N; i++) {
            if (i == target) {
                char n = (char) (S.charAt(target) - ('A' - 'a'));
                System.out.print(n);
                continue;
            }
            System.out.print(S.charAt(i));
        }
        System.out.println();
    } int target = (int) (K - 1); target (int) (K - 1) K 1 for (int i = 0; i < N; i++) {
            if (i == target) {
                char n = (char) (S.charAt(target) - ('A' - 'a'));
                System.out.print(n);
                continue;
            }
            System.out.print(S.charAt(i));
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (i == target) {
                char n = (char) (S.charAt(target) - ('A' - 'a'));
                System.out.print(n);
                continue;
            }
            System.out.print(S.charAt(i));
        } {
            if (i == target) {
                char n = (char) (S.charAt(target) - ('A' - 'a'));
                System.out.print(n);
                continue;
            }
            System.out.print(S.charAt(i));
        } if (i == target) {
                char n = (char) (S.charAt(target) - ('A' - 'a'));
                System.out.print(n);
                continue;
            } i == target i target {
                char n = (char) (S.charAt(target) - ('A' - 'a'));
                System.out.print(n);
                continue;
            } char n = (char) (S.charAt(target) - ('A' - 'a')); n (char) (S.charAt(target) - ('A' - 'a')) S.charAt(target) S.charAt S target ('A' - 'a') 'A' 'a' System.out.print(n) System.out.print System.out System System.out n continue; System.out.print(S.charAt(i)) System.out.print System.out System System.out S.charAt(i) S.charAt S i System.out.println() System.out.println System.out System System.out long N N long K K String S S public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long K;
        K = sc.nextLong();
        String S;
        S = sc.next();

        final Solver solver = new Solver();
        solver.solve(N, K, S);
    }
} public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long K;
        K = sc.nextLong();
        String S;
        S = sc.next();

        final Solver solver = new Solver();
        solver.solve(N, K, S);
    }
} Main
import java.io.*;
import java.util.*;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long K;
        K = sc.nextLong();
        String S;
        S = sc.next();

        final Solver solver = new Solver();
        solver.solve(N, K, S);
    }
}

class Solver {
    public void solve(long N, long K, String S) {
        int target = (int) (K - 1);
        for (int i = 0; i < N; i++) {
            if (i == target) {
                char n = (char) (S.charAt(target) - ('A' - 'a'));
                System.out.print(n);
                continue;
            }
            System.out.print(S.charAt(i));
        }
        System.out.println();
    }
}

