import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    }
    public static void do_(Scanner inp) {
        int n = inp.nextInt();
        int k = inp.nextInt();
        k -= 1;
        String s = inp.next();
        String s1 = s.substring(0, k);
        String s2 = Character.toString(s.charAt(k));
        String s3 = s.substring(k + 1, n);
        System.out.println(s1 + s2.toLowerCase() + s3);
    }
} import java.util.*; util.* java class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    }
    public static void do_(Scanner inp) {
        int n = inp.nextInt();
        int k = inp.nextInt();
        k -= 1;
        String s = inp.next();
        String s1 = s.substring(0, k);
        String s2 = Character.toString(s.charAt(k));
        String s3 = s.substring(k + 1, n);
        System.out.println(s1 + s2.toLowerCase() + s3);
    }
} Main public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    } main {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    } Scanner inp = new Scanner(System.in); inp new Scanner(System.in) do_(inp) do_ inp inp.close() inp.close inp String args[] args public static void do_(Scanner inp) {
        int n = inp.nextInt();
        int k = inp.nextInt();
        k -= 1;
        String s = inp.next();
        String s1 = s.substring(0, k);
        String s2 = Character.toString(s.charAt(k));
        String s3 = s.substring(k + 1, n);
        System.out.println(s1 + s2.toLowerCase() + s3);
    } do_ {
        int n = inp.nextInt();
        int k = inp.nextInt();
        k -= 1;
        String s = inp.next();
        String s1 = s.substring(0, k);
        String s2 = Character.toString(s.charAt(k));
        String s3 = s.substring(k + 1, n);
        System.out.println(s1 + s2.toLowerCase() + s3);
    } int n = inp.nextInt(); n inp.nextInt() inp.nextInt inp int k = inp.nextInt(); k inp.nextInt() inp.nextInt inp k -= 1 k 1 String s = inp.next(); s inp.next() inp.next inp String s1 = s.substring(0, k); s1 s.substring(0, k) s.substring s 0 k String s2 = Character.toString(s.charAt(k)); s2 Character.toString(s.charAt(k)) Character.toString Character s.charAt(k) s.charAt s k String s3 = s.substring(k + 1, n); s3 s.substring(k + 1, n) s.substring s k + 1 k 1 n System.out.println(s1 + s2.toLowerCase() + s3) System.out.println System.out System System.out s1 + s2.toLowerCase() + s3 s1 + s2.toLowerCase() + s3 s1 s2.toLowerCase() s2.toLowerCase s2 s3 Scanner inp inp
import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    }
    public static void do_(Scanner inp) {
        int n = inp.nextInt();
        int k = inp.nextInt();
        k -= 1;
        String s = inp.next();
        String s1 = s.substring(0, k);
        String s2 = Character.toString(s.charAt(k));
        String s3 = s.substring(k + 1, n);
        System.out.println(s1 + s2.toLowerCase() + s3);
    }
}
