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();
        sc.close();

        String ans = "";
        for (int i = 0; i < n; i++) {
            if (i == k - 1) {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } else {
                ans += s.charAt(i);
            }
        }

        System.out.println(ans);
    }

} 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();
        sc.close();

        String ans = "";
        for (int i = 0; i < n; i++) {
            if (i == k - 1) {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } else {
                ans += s.charAt(i);
            }
        }

        System.out.println(ans);
    }

} 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();
        sc.close();

        String ans = "";
        for (int i = 0; i < n; i++) {
            if (i == k - 1) {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } else {
                ans += s.charAt(i);
            }
        }

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        String s = sc.next();
        sc.close();

        String ans = "";
        for (int i = 0; i < n; i++) {
            if (i == k - 1) {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } else {
                ans += s.charAt(i);
            }
        }

        System.out.println(ans);
    } 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 sc.close() sc.close sc String ans = ""; ans "" for (int i = 0; i < n; i++) {
            if (i == k - 1) {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } else {
                ans += s.charAt(i);
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (i == k - 1) {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } else {
                ans += s.charAt(i);
            }
        } {
            if (i == k - 1) {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } else {
                ans += s.charAt(i);
            }
        } if (i == k - 1) {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } else {
                ans += s.charAt(i);
            } i == k - 1 i k - 1 k 1 {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } ans += String.valueOf(s.charAt(i)).toLowerCase() ans String.valueOf(s.charAt(i)).toLowerCase() String.valueOf(s.charAt(i)).toLowerCase String.valueOf(s.charAt(i)) String.valueOf String s.charAt(i) s.charAt s i {
                ans += s.charAt(i);
            } ans += s.charAt(i) ans s.charAt(i) s.charAt s i System.out.println(ans) System.out.println System.out System System.out ans 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();
        sc.close();

        String ans = "";
        for (int i = 0; i < n; i++) {
            if (i == k - 1) {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } else {
                ans += s.charAt(i);
            }
        }

        System.out.println(ans);
    }

} 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();
        sc.close();

        String ans = "";
        for (int i = 0; i < n; i++) {
            if (i == k - 1) {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } else {
                ans += s.charAt(i);
            }
        }

        System.out.println(ans);
    }

} 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();
        sc.close();

        String ans = "";
        for (int i = 0; i < n; i++) {
            if (i == k - 1) {
                ans += String.valueOf(s.charAt(i)).toLowerCase();
            } else {
                ans += s.charAt(i);
            }
        }

        System.out.println(ans);
    }

}
