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() - 1;
		String S = sc.next();
		sc.close();
		String[] s = S.split("");
		s [K] = s[K].toLowerCase();
		StringBuffer bf = new StringBuffer();
		for(int i=0;i<N;i++) {
			bf.append(s[i]);
		}
	System.out.print(bf.toString());
	}
} 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() - 1;
		String S = sc.next();
		sc.close();
		String[] s = S.split("");
		s [K] = s[K].toLowerCase();
		StringBuffer bf = new StringBuffer();
		for(int i=0;i<N;i++) {
			bf.append(s[i]);
		}
	System.out.print(bf.toString());
	}
} Main public static void main(String[]args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt() - 1;
		String S = sc.next();
		sc.close();
		String[] s = S.split("");
		s [K] = s[K].toLowerCase();
		StringBuffer bf = new StringBuffer();
		for(int i=0;i<N;i++) {
			bf.append(s[i]);
		}
	System.out.print(bf.toString());
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt() - 1;
		String S = sc.next();
		sc.close();
		String[] s = S.split("");
		s [K] = s[K].toLowerCase();
		StringBuffer bf = new StringBuffer();
		for(int i=0;i<N;i++) {
			bf.append(s[i]);
		}
	System.out.print(bf.toString());
	} 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() - 1; K sc.nextInt() - 1 sc.nextInt() sc.nextInt sc 1 String S = sc.next(); S sc.next() sc.next sc sc.close() sc.close sc String[] s = S.split(""); s S.split("") S.split S "" s [K] = s[K].toLowerCase() s [K] s K s[K].toLowerCase() s[K].toLowerCase s[K] s K StringBuffer bf = new StringBuffer(); bf new StringBuffer() for(int i=0;i<N;i++) {
			bf.append(s[i]);
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			bf.append(s[i]);
		} {
			bf.append(s[i]);
		} bf.append(s[i]) bf.append bf s[i] s i System.out.print(bf.toString()) System.out.print System.out System System.out bf.toString() bf.toString bf 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() - 1;
		String S = sc.next();
		sc.close();
		String[] s = S.split("");
		s [K] = s[K].toLowerCase();
		StringBuffer bf = new StringBuffer();
		for(int i=0;i<N;i++) {
			bf.append(s[i]);
		}
	System.out.print(bf.toString());
	}
} public class Main {
	public static void main(String[]args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt() - 1;
		String S = sc.next();
		sc.close();
		String[] s = S.split("");
		s [K] = s[K].toLowerCase();
		StringBuffer bf = new StringBuffer();
		for(int i=0;i<N;i++) {
			bf.append(s[i]);
		}
	System.out.print(bf.toString());
	}
} 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() - 1;
		String S = sc.next();
		sc.close();
		String[] s = S.split("");
		s [K] = s[K].toLowerCase();
		StringBuffer bf = new StringBuffer();
		for(int i=0;i<N;i++) {
			bf.append(s[i]);
		}
	System.out.print(bf.toString());
	}
}