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();
        String ans;

        StringBuilder sb = new StringBuilder(N);
        for(int i = 0; i < N; i++){
            if(i == K - 1){
                sb.append(S.substring(i, i + 1).toLowerCase());
            }else{
                sb.append(S.substring(i, i + 1));
            }
        }
        ans = sb.toString();
        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();
        String ans;

        StringBuilder sb = new StringBuilder(N);
        for(int i = 0; i < N; i++){
            if(i == K - 1){
                sb.append(S.substring(i, i + 1).toLowerCase());
            }else{
                sb.append(S.substring(i, i + 1));
            }
        }
        ans = sb.toString();
        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();
        String ans;

        StringBuilder sb = new StringBuilder(N);
        for(int i = 0; i < N; i++){
            if(i == K - 1){
                sb.append(S.substring(i, i + 1).toLowerCase());
            }else{
                sb.append(S.substring(i, i + 1));
            }
        }
        ans = sb.toString();
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        String S = sc.next();
        String ans;

        StringBuilder sb = new StringBuilder(N);
        for(int i = 0; i < N; i++){
            if(i == K - 1){
                sb.append(S.substring(i, i + 1).toLowerCase());
            }else{
                sb.append(S.substring(i, i + 1));
            }
        }
        ans = sb.toString();
        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 String ans; ans StringBuilder sb = new StringBuilder(N); sb new StringBuilder(N) for(int i = 0; i < N; i++){
            if(i == K - 1){
                sb.append(S.substring(i, i + 1).toLowerCase());
            }else{
                sb.append(S.substring(i, i + 1));
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if(i == K - 1){
                sb.append(S.substring(i, i + 1).toLowerCase());
            }else{
                sb.append(S.substring(i, i + 1));
            }
        } {
            if(i == K - 1){
                sb.append(S.substring(i, i + 1).toLowerCase());
            }else{
                sb.append(S.substring(i, i + 1));
            }
        } if(i == K - 1){
                sb.append(S.substring(i, i + 1).toLowerCase());
            }else{
                sb.append(S.substring(i, i + 1));
            } i == K - 1 i K - 1 K 1 {
                sb.append(S.substring(i, i + 1).toLowerCase());
            } sb.append(S.substring(i, i + 1).toLowerCase()) sb.append sb S.substring(i, i + 1).toLowerCase() S.substring(i, i + 1).toLowerCase S.substring(i, i + 1) S.substring S i i + 1 i 1 {
                sb.append(S.substring(i, i + 1));
            } sb.append(S.substring(i, i + 1)) sb.append sb S.substring(i, i + 1) S.substring S i i + 1 i 1 ans = sb.toString() ans sb.toString() sb.toString sb 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();
        String ans;

        StringBuilder sb = new StringBuilder(N);
        for(int i = 0; i < N; i++){
            if(i == K - 1){
                sb.append(S.substring(i, i + 1).toLowerCase());
            }else{
                sb.append(S.substring(i, i + 1));
            }
        }
        ans = sb.toString();
        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();
        String ans;

        StringBuilder sb = new StringBuilder(N);
        for(int i = 0; i < N; i++){
            if(i == K - 1){
                sb.append(S.substring(i, i + 1).toLowerCase());
            }else{
                sb.append(S.substring(i, i + 1));
            }
        }
        ans = sb.toString();
        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();
        String ans;

        StringBuilder sb = new StringBuilder(N);
        for(int i = 0; i < N; i++){
            if(i == K - 1){
                sb.append(S.substring(i, i + 1).toLowerCase());
            }else{
                sb.append(S.substring(i, i + 1));
            }
        }
        ans = sb.toString();
        System.out.println(ans);
    }
}