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());
        String[] x = sc.next().split("");
        String result = "";
        for (int i = 0; i < a; i++) {
            if (i == (b - 1)) {
                result += x[i].toLowerCase();
            } else {
                result += x[i];
            }
        }
        
        System.out.println(result);
    }
} 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());
        String[] x = sc.next().split("");
        String result = "";
        for (int i = 0; i < a; i++) {
            if (i == (b - 1)) {
                result += x[i].toLowerCase();
            } else {
                result += x[i];
            }
        }
        
        System.out.println(result);
    }
} 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());
        String[] x = sc.next().split("");
        String result = "";
        for (int i = 0; i < a; i++) {
            if (i == (b - 1)) {
                result += x[i].toLowerCase();
            } else {
                result += x[i];
            }
        }
        
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        String[] x = sc.next().split("");
        String result = "";
        for (int i = 0; i < a; i++) {
            if (i == (b - 1)) {
                result += x[i].toLowerCase();
            } else {
                result += x[i];
            }
        }
        
        System.out.println(result);
    } 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 String[] x = sc.next().split(""); x sc.next().split("") sc.next().split sc.next() sc.next sc "" String result = ""; result "" for (int i = 0; i < a; i++) {
            if (i == (b - 1)) {
                result += x[i].toLowerCase();
            } else {
                result += x[i];
            }
        } int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
            if (i == (b - 1)) {
                result += x[i].toLowerCase();
            } else {
                result += x[i];
            }
        } {
            if (i == (b - 1)) {
                result += x[i].toLowerCase();
            } else {
                result += x[i];
            }
        } if (i == (b - 1)) {
                result += x[i].toLowerCase();
            } else {
                result += x[i];
            } i == (b - 1) i (b - 1) b 1 {
                result += x[i].toLowerCase();
            } result += x[i].toLowerCase() result x[i].toLowerCase() x[i].toLowerCase x[i] x i {
                result += x[i];
            } result += x[i] result x[i] x i System.out.println(result) System.out.println System.out System System.out result 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());
        String[] x = sc.next().split("");
        String result = "";
        for (int i = 0; i < a; i++) {
            if (i == (b - 1)) {
                result += x[i].toLowerCase();
            } else {
                result += x[i];
            }
        }
        
        System.out.println(result);
    }
} 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());
        String[] x = sc.next().split("");
        String result = "";
        for (int i = 0; i < a; i++) {
            if (i == (b - 1)) {
                result += x[i].toLowerCase();
            } else {
                result += x[i];
            }
        }
        
        System.out.println(result);
    }
} 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());
        String[] x = sc.next().split("");
        String result = "";
        for (int i = 0; i < a; i++) {
            if (i == (b - 1)) {
                result += x[i].toLowerCase();
            } else {
                result += x[i];
            }
        }
        
        System.out.println(result);
    }
}
