import java.util.Scanner;
import java.util.StringJoiner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String[] s = sc.next().split("");
        s[k - 1] = s[k - 1].toLowerCase();
        StringJoiner sj = new StringJoiner("");
        for (int i = 0; i < n; i++) {
            sj.add(s[i]);
        }
        System.out.println(sj.toString());
    }

} import java.util.Scanner; Scanner java.util import java.util.StringJoiner; StringJoiner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String[] s = sc.next().split("");
        s[k - 1] = s[k - 1].toLowerCase();
        StringJoiner sj = new StringJoiner("");
        for (int i = 0; i < n; i++) {
            sj.add(s[i]);
        }
        System.out.println(sj.toString());
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String[] s = sc.next().split("");
        s[k - 1] = s[k - 1].toLowerCase();
        StringJoiner sj = new StringJoiner("");
        for (int i = 0; i < n; i++) {
            sj.add(s[i]);
        }
        System.out.println(sj.toString());
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String[] s = sc.next().split("");
        s[k - 1] = s[k - 1].toLowerCase();
        StringJoiner sj = new StringJoiner("");
        for (int i = 0; i < n; i++) {
            sj.add(s[i]);
        }
        System.out.println(sj.toString());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc String[] s = sc.next().split(""); s sc.next().split("") sc.next().split sc.next() sc.next sc "" s[k - 1] = s[k - 1].toLowerCase() s[k - 1] s k - 1 k 1 s[k - 1].toLowerCase() s[k - 1].toLowerCase s[k - 1] s k - 1 k 1 StringJoiner sj = new StringJoiner(""); sj new StringJoiner("") for (int i = 0; i < n; i++) {
            sj.add(s[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            sj.add(s[i]);
        } {
            sj.add(s[i]);
        } sj.add(s[i]) sj.add sj s[i] s i System.out.println(sj.toString()) System.out.println System.out System System.out sj.toString() sj.toString sj String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String[] s = sc.next().split("");
        s[k - 1] = s[k - 1].toLowerCase();
        StringJoiner sj = new StringJoiner("");
        for (int i = 0; i < n; i++) {
            sj.add(s[i]);
        }
        System.out.println(sj.toString());
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String[] s = sc.next().split("");
        s[k - 1] = s[k - 1].toLowerCase();
        StringJoiner sj = new StringJoiner("");
        for (int i = 0; i < n; i++) {
            sj.add(s[i]);
        }
        System.out.println(sj.toString());
    }

} Main
import java.util.Scanner;
import java.util.StringJoiner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String[] s = sc.next().split("");
        s[k - 1] = s[k - 1].toLowerCase();
        StringJoiner sj = new StringJoiner("");
        for (int i = 0; i < n; i++) {
            sj.add(s[i]);
        }
        System.out.println(sj.toString());
    }

}
