import java.util.Scanner;

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();
        String tmp = s.substring(k - 1, k).toLowerCase();
        String ans = s.substring(0, k - 1);
        System.out.print(ans + tmp);
        String ans2 = s.substring(k, s.length());
        System.out.println(ans2);
    }
} import java.util.Scanner; Scanner 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();
        String tmp = s.substring(k - 1, k).toLowerCase();
        String ans = s.substring(0, k - 1);
        System.out.print(ans + tmp);
        String ans2 = s.substring(k, s.length());
        System.out.println(ans2);
    }
} 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();
        String tmp = s.substring(k - 1, k).toLowerCase();
        String ans = s.substring(0, k - 1);
        System.out.print(ans + tmp);
        String ans2 = s.substring(k, s.length());
        System.out.println(ans2);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String s = sc.next();
        String tmp = s.substring(k - 1, k).toLowerCase();
        String ans = s.substring(0, k - 1);
        System.out.print(ans + tmp);
        String ans2 = s.substring(k, s.length());
        System.out.println(ans2);
    } 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(); s sc.next() sc.next sc String tmp = s.substring(k - 1, k).toLowerCase(); tmp s.substring(k - 1, k).toLowerCase() s.substring(k - 1, k).toLowerCase s.substring(k - 1, k) s.substring s k - 1 k 1 k String ans = s.substring(0, k - 1); ans s.substring(0, k - 1) s.substring s 0 k - 1 k 1 System.out.print(ans + tmp) System.out.print System.out System System.out ans + tmp ans tmp String ans2 = s.substring(k, s.length()); ans2 s.substring(k, s.length()) s.substring s k s.length() s.length s System.out.println(ans2) System.out.println System.out System System.out ans2 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();
        String tmp = s.substring(k - 1, k).toLowerCase();
        String ans = s.substring(0, k - 1);
        System.out.print(ans + tmp);
        String ans2 = s.substring(k, s.length());
        System.out.println(ans2);
    }
} 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();
        String tmp = s.substring(k - 1, k).toLowerCase();
        String ans = s.substring(0, k - 1);
        System.out.print(ans + tmp);
        String ans2 = s.substring(k, s.length());
        System.out.println(ans2);
    }
} Main
import java.util.Scanner;

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();
        String tmp = s.substring(k - 1, k).toLowerCase();
        String ans = s.substring(0, k - 1);
        System.out.print(ans + tmp);
        String ans2 = s.substring(k, s.length());
        System.out.println(ans2);
    }
}