import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        String S = sc.next();
        String[] s = S.split("");
        s[K-1] = s[K-1].toLowerCase();
        String ans = "";
        for(int i = 0; i < N; i++) {
            ans += s[i];
        }

        System.out.println(ans);
    }
} import java.util.*; util.* java class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        String S = sc.next();
        String[] s = S.split("");
        s[K-1] = s[K-1].toLowerCase();
        String ans = "";
        for(int i = 0; i < N; i++) {
            ans += s[i];
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        String S = sc.next();
        String[] s = S.split("");
        s[K-1] = s[K-1].toLowerCase();
        String ans = "";
        for(int i = 0; i < N; i++) {
            ans += s[i];
        }

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        String S = sc.next();
        String[] s = S.split("");
        s[K-1] = s[K-1].toLowerCase();
        String ans = "";
        for(int i = 0; i < N; i++) {
            ans += s[i];
        }

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int K = Integer.parseInt(sc.next()); K Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String S = sc.next(); S sc.next() sc.next sc String[] s = S.split(""); s S.split("") S.split S "" s[K-1] = s[K-1].toLowerCase() s[K-1] s K-1 K 1 s[K-1].toLowerCase() s[K-1].toLowerCase s[K-1] s K-1 K 1 String ans = ""; ans "" for(int i = 0; i < N; i++) {
            ans += s[i];
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            ans += s[i];
        } {
            ans += s[i];
        } ans += s[i] ans s[i] s i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        String S = sc.next();
        String[] s = S.split("");
        s[K-1] = s[K-1].toLowerCase();
        String ans = "";
        for(int i = 0; i < N; i++) {
            ans += s[i];
        }

        System.out.println(ans);
    }
}