import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        char[] ch = sc.next().toCharArray();
        String ans = "";
        for (int i = 0; i < a; i++) {
            if (i == b - 1) {
                ans += Character.toLowerCase(ch[i]);
            } else {
                ans += ch[i];
            }
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        char[] ch = sc.next().toCharArray();
        String ans = "";
        for (int i = 0; i < a; i++) {
            if (i == b - 1) {
                ans += Character.toLowerCase(ch[i]);
            } else {
                ans += ch[i];
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        char[] ch = sc.next().toCharArray();
        String ans = "";
        for (int i = 0; i < a; i++) {
            if (i == b - 1) {
                ans += Character.toLowerCase(ch[i]);
            } else {
                ans += ch[i];
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        char[] ch = sc.next().toCharArray();
        String ans = "";
        for (int i = 0; i < a; i++) {
            if (i == b - 1) {
                ans += Character.toLowerCase(ch[i]);
            } else {
                ans += ch[i];
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc char[] ch = sc.next().toCharArray(); ch sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc String ans = ""; ans "" for (int i = 0; i < a; i++) {
            if (i == b - 1) {
                ans += Character.toLowerCase(ch[i]);
            } else {
                ans += ch[i];
            }
        } int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
            if (i == b - 1) {
                ans += Character.toLowerCase(ch[i]);
            } else {
                ans += ch[i];
            }
        } {
            if (i == b - 1) {
                ans += Character.toLowerCase(ch[i]);
            } else {
                ans += ch[i];
            }
        } if (i == b - 1) {
                ans += Character.toLowerCase(ch[i]);
            } else {
                ans += ch[i];
            } i == b - 1 i b - 1 b 1 {
                ans += Character.toLowerCase(ch[i]);
            } ans += Character.toLowerCase(ch[i]) ans Character.toLowerCase(ch[i]) Character.toLowerCase Character ch[i] ch i {
                ans += ch[i];
            } ans += ch[i] ans ch[i] ch 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) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        char[] ch = sc.next().toCharArray();
        String ans = "";
        for (int i = 0; i < a; i++) {
            if (i == b - 1) {
                ans += Character.toLowerCase(ch[i]);
            } else {
                ans += ch[i];
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        char[] ch = sc.next().toCharArray();
        String ans = "";
        for (int i = 0; i < a; i++) {
            if (i == b - 1) {
                ans += Character.toLowerCase(ch[i]);
            } else {
                ans += ch[i];
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        char[] ch = sc.next().toCharArray();
        String ans = "";
        for (int i = 0; i < a; i++) {
            if (i == b - 1) {
                ans += Character.toLowerCase(ch[i]);
            } else {
                ans += ch[i];
            }
        }
        System.out.println(ans);
    }
}
