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 substring = S.substring(K-1, K);
		String lower = substring.toLowerCase();
		
		String front = S.substring(0,K-1);
		String back = S.substring(K,N);
		
		System.out.println(front + lower + back);
		
		sc.close();
		
	}

} 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 substring = S.substring(K-1, K);
		String lower = substring.toLowerCase();
		
		String front = S.substring(0,K-1);
		String back = S.substring(K,N);
		
		System.out.println(front + lower + back);
		
		sc.close();
		
	}

} 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 substring = S.substring(K-1, K);
		String lower = substring.toLowerCase();
		
		String front = S.substring(0,K-1);
		String back = S.substring(K,N);
		
		System.out.println(front + lower + back);
		
		sc.close();
		
	} main {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int K = sc.nextInt();
		String  S = sc.next();
		
		String substring = S.substring(K-1, K);
		String lower = substring.toLowerCase();
		
		String front = S.substring(0,K-1);
		String back = S.substring(K,N);
		
		System.out.println(front + lower + back);
		
		sc.close();
		
	} 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 substring = S.substring(K-1, K); substring S.substring(K-1, K) S.substring S K-1 K 1 K String lower = substring.toLowerCase(); lower substring.toLowerCase() substring.toLowerCase substring String front = S.substring(0,K-1); front S.substring(0,K-1) S.substring S 0 K-1 K 1 String back = S.substring(K,N); back S.substring(K,N) S.substring S K N System.out.println(front + lower + back) System.out.println System.out System System.out front + lower + back front + lower + back front lower back sc.close() sc.close sc 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 substring = S.substring(K-1, K);
		String lower = substring.toLowerCase();
		
		String front = S.substring(0,K-1);
		String back = S.substring(K,N);
		
		System.out.println(front + lower + back);
		
		sc.close();
		
	}

} 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 substring = S.substring(K-1, K);
		String lower = substring.toLowerCase();
		
		String front = S.substring(0,K-1);
		String back = S.substring(K,N);
		
		System.out.println(front + lower + back);
		
		sc.close();
		
	}

} 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 substring = S.substring(K-1, K);
		String lower = substring.toLowerCase();
		
		String front = S.substring(0,K-1);
		String back = S.substring(K,N);
		
		System.out.println(front + lower + back);
		
		sc.close();
		
	}

}
