import java.util.*;

public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        int n = Integer.parseInt(a.split(" ")[0]);
        int k = Integer.parseInt(a.split(" ")[1]);

        String s = sc.nextLine();
        char[] ans = new char[n];
        for (int i = 0; i < n; i++) {
            if (k == i + 1) {
                ans[i] = s.toLowerCase().charAt(i);
            } else {
                ans[i] = s.charAt(i);
            }
        }

        System.out.println(ans);

        return;
    }
} import java.util.*; util.* java public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        int n = Integer.parseInt(a.split(" ")[0]);
        int k = Integer.parseInt(a.split(" ")[1]);

        String s = sc.nextLine();
        char[] ans = new char[n];
        for (int i = 0; i < n; i++) {
            if (k == i + 1) {
                ans[i] = s.toLowerCase().charAt(i);
            } else {
                ans[i] = s.charAt(i);
            }
        }

        System.out.println(ans);

        return;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        int n = Integer.parseInt(a.split(" ")[0]);
        int k = Integer.parseInt(a.split(" ")[1]);

        String s = sc.nextLine();
        char[] ans = new char[n];
        for (int i = 0; i < n; i++) {
            if (k == i + 1) {
                ans[i] = s.toLowerCase().charAt(i);
            } else {
                ans[i] = s.charAt(i);
            }
        }

        System.out.println(ans);

        return;
    } main {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        int n = Integer.parseInt(a.split(" ")[0]);
        int k = Integer.parseInt(a.split(" ")[1]);

        String s = sc.nextLine();
        char[] ans = new char[n];
        for (int i = 0; i < n; i++) {
            if (k == i + 1) {
                ans[i] = s.toLowerCase().charAt(i);
            } else {
                ans[i] = s.charAt(i);
            }
        }

        System.out.println(ans);

        return;
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String a = sc.nextLine(); a sc.nextLine() sc.nextLine sc int n = Integer.parseInt(a.split(" ")[0]); n Integer.parseInt(a.split(" ")[0]) Integer.parseInt Integer a.split(" ")[0] a.split(" ") a.split a " " 0 int k = Integer.parseInt(a.split(" ")[1]); k Integer.parseInt(a.split(" ")[1]) Integer.parseInt Integer a.split(" ")[1] a.split(" ") a.split a " " 1 String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc char[] ans = new char[n]; ans new char[n] n for (int i = 0; i < n; i++) {
            if (k == i + 1) {
                ans[i] = s.toLowerCase().charAt(i);
            } else {
                ans[i] = s.charAt(i);
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (k == i + 1) {
                ans[i] = s.toLowerCase().charAt(i);
            } else {
                ans[i] = s.charAt(i);
            }
        } {
            if (k == i + 1) {
                ans[i] = s.toLowerCase().charAt(i);
            } else {
                ans[i] = s.charAt(i);
            }
        } if (k == i + 1) {
                ans[i] = s.toLowerCase().charAt(i);
            } else {
                ans[i] = s.charAt(i);
            } k == i + 1 k i + 1 i 1 {
                ans[i] = s.toLowerCase().charAt(i);
            } ans[i] = s.toLowerCase().charAt(i) ans[i] ans i s.toLowerCase().charAt(i) s.toLowerCase().charAt s.toLowerCase() s.toLowerCase s i {
                ans[i] = s.charAt(i);
            } ans[i] = s.charAt(i) ans[i] ans i s.charAt(i) s.charAt s i System.out.println(ans) System.out.println System.out System System.out ans return; String[] args args public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        int n = Integer.parseInt(a.split(" ")[0]);
        int k = Integer.parseInt(a.split(" ")[1]);

        String s = sc.nextLine();
        char[] ans = new char[n];
        for (int i = 0; i < n; i++) {
            if (k == i + 1) {
                ans[i] = s.toLowerCase().charAt(i);
            } else {
                ans[i] = s.charAt(i);
            }
        }

        System.out.println(ans);

        return;
    }
} public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        int n = Integer.parseInt(a.split(" ")[0]);
        int k = Integer.parseInt(a.split(" ")[1]);

        String s = sc.nextLine();
        char[] ans = new char[n];
        for (int i = 0; i < n; i++) {
            if (k == i + 1) {
                ans[i] = s.toLowerCase().charAt(i);
            } else {
                ans[i] = s.charAt(i);
            }
        }

        System.out.println(ans);

        return;
    }
} Main
import java.util.*;

public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        int n = Integer.parseInt(a.split(" ")[0]);
        int k = Integer.parseInt(a.split(" ")[1]);

        String s = sc.nextLine();
        char[] ans = new char[n];
        for (int i = 0; i < n; i++) {
            if (k == i + 1) {
                ans[i] = s.toLowerCase().charAt(i);
            } else {
                ans[i] = s.charAt(i);
            }
        }

        System.out.println(ans);

        return;
    }
}
