import 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();
        if (K == 1) {
            System.out.println(S.substring(K-1, K).toLowerCase() + S.substring(K));
        } else if (K == N) {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase());
        } else {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N));
        }
    }
} import java.util.*; util.* java 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();
        if (K == 1) {
            System.out.println(S.substring(K-1, K).toLowerCase() + S.substring(K));
        } else if (K == N) {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase());
        } else {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N));
        }
    }
} 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();
        if (K == 1) {
            System.out.println(S.substring(K-1, K).toLowerCase() + S.substring(K));
        } else if (K == N) {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase());
        } else {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N));
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        String S = sc.next();
        sc.close();
        if (K == 1) {
            System.out.println(S.substring(K-1, K).toLowerCase() + S.substring(K));
        } else if (K == N) {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase());
        } else {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N));
        }
    } 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 if (K == 1) {
            System.out.println(S.substring(K-1, K).toLowerCase() + S.substring(K));
        } else if (K == N) {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase());
        } else {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N));
        } K == 1 K 1 {
            System.out.println(S.substring(K-1, K).toLowerCase() + S.substring(K));
        } System.out.println(S.substring(K-1, K).toLowerCase() + S.substring(K)) System.out.println System.out System System.out S.substring(K-1, K).toLowerCase() + S.substring(K) 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 S.substring(K) S.substring S K if (K == N) {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase());
        } else {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N));
        } K == N K N {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase());
        } System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase()) System.out.println System.out System System.out S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() S.substring(0, K-1) S.substring S 0 K-1 K 1 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 {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N));
        } System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N)) System.out.println System.out System System.out S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N) S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N) S.substring(0, K-1) S.substring S 0 K-1 K 1 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 S.substring(K, N) S.substring S K N 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();
        if (K == 1) {
            System.out.println(S.substring(K-1, K).toLowerCase() + S.substring(K));
        } else if (K == N) {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase());
        } else {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N));
        }
    }
} 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();
        if (K == 1) {
            System.out.println(S.substring(K-1, K).toLowerCase() + S.substring(K));
        } else if (K == N) {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase());
        } else {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N));
        }
    }
} Main
import 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();
        if (K == 1) {
            System.out.println(S.substring(K-1, K).toLowerCase() + S.substring(K));
        } else if (K == N) {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase());
        } else {
            System.out.println(S.substring(0, K-1) + S.substring(K-1, K).toLowerCase() + S.substring(K, N));
        }
    }
}
