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[] sList = sc.next().split("");
        sList[k - 1] = sList[k - 1].toLowerCase();
        String ans = "";
        for (String s : sList) {
          ans += s;
        }
    
		// 出力
		System.out.println(ans);
	}
} 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[] sList = sc.next().split("");
        sList[k - 1] = sList[k - 1].toLowerCase();
        String ans = "";
        for (String s : sList) {
          ans += s;
        }
    
		// 出力
		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[] sList = sc.next().split("");
        sList[k - 1] = sList[k - 1].toLowerCase();
        String ans = "";
        for (String s : sList) {
          ans += s;
        }
    
		// 出力
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int n = sc.nextInt();
		int k = sc.nextInt();
    
		// 文字列の入力
		String[] sList = sc.next().split("");
        sList[k - 1] = sList[k - 1].toLowerCase();
        String ans = "";
        for (String s : sList) {
          ans += s;
        }
    
		// 出力
		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[] sList = sc.next().split(""); sList sc.next().split("") sc.next().split sc.next() sc.next sc "" sList[k - 1] = sList[k - 1].toLowerCase() sList[k - 1] sList k - 1 k 1 sList[k - 1].toLowerCase() sList[k - 1].toLowerCase sList[k - 1] sList k - 1 k 1 String ans = ""; ans "" for (String s : sList) {
          ans += s;
        } String s sList {
          ans += s;
        } {
          ans += s;
        } ans += s ans s 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[] sList = sc.next().split("");
        sList[k - 1] = sList[k - 1].toLowerCase();
        String ans = "";
        for (String s : sList) {
          ans += s;
        }
    
		// 出力
		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[] sList = sc.next().split("");
        sList[k - 1] = sList[k - 1].toLowerCase();
        String ans = "";
        for (String s : sList) {
          ans += s;
        }
    
		// 出力
		System.out.println(ans);
	}
} 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[] sList = sc.next().split("");
        sList[k - 1] = sList[k - 1].toLowerCase();
        String ans = "";
        for (String s : sList) {
          ans += s;
        }
    
		// 出力
		System.out.println(ans);
	}
}