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 a = S.substring(K - 1);
		String b = a.toLowerCase();
		char c = b.charAt(0);
		String d = S.substring(K);
		String e = S.substring(0, K - 1);
		System.out.println(e + c + d);

	}

} 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 a = S.substring(K - 1);
		String b = a.toLowerCase();
		char c = b.charAt(0);
		String d = S.substring(K);
		String e = S.substring(0, K - 1);
		System.out.println(e + c + d);

	}

} 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 a = S.substring(K - 1);
		String b = a.toLowerCase();
		char c = b.charAt(0);
		String d = S.substring(K);
		String e = S.substring(0, K - 1);
		System.out.println(e + c + d);

	} main {
		// ここにコードを挿入
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		String S = sc.next();
		String a = S.substring(K - 1);
		String b = a.toLowerCase();
		char c = b.charAt(0);
		String d = S.substring(K);
		String e = S.substring(0, K - 1);
		System.out.println(e + c + d);

	} 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 a = S.substring(K - 1); a S.substring(K - 1) S.substring S K - 1 K 1 String b = a.toLowerCase(); b a.toLowerCase() a.toLowerCase a char c = b.charAt(0); c b.charAt(0) b.charAt b 0 String d = S.substring(K); d S.substring(K) S.substring S K String e = S.substring(0, K - 1); e S.substring(0, K - 1) S.substring S 0 K - 1 K 1 System.out.println(e + c + d) System.out.println System.out System System.out e + c + d e + c + d e c d 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 a = S.substring(K - 1);
		String b = a.toLowerCase();
		char c = b.charAt(0);
		String d = S.substring(K);
		String e = S.substring(0, K - 1);
		System.out.println(e + c + d);

	}

} 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 a = S.substring(K - 1);
		String b = a.toLowerCase();
		char c = b.charAt(0);
		String d = S.substring(K);
		String e = S.substring(0, K - 1);
		System.out.println(e + c + d);

	}

} 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 a = S.substring(K - 1);
		String b = a.toLowerCase();
		char c = b.charAt(0);
		String d = S.substring(K);
		String e = S.substring(0, K - 1);
		System.out.println(e + c + d);

	}

}