import java.util.Scanner;

public class Main { 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int strCount = Integer.parseInt(line[0]);
		int changeNumber = Integer.parseInt(line[1]);
		String target = sc.nextLine();
		
		String result = "";
		for(int i = 0;i<strCount;i++) {
			Character tmp = target.charAt(i);
			if((changeNumber - 1) == i) {
				tmp = tmp.toLowerCase(tmp);
			}
			
			result += tmp;
		}

		
		System.out.println(result);

		
		
		
	}
}
	
	 import java.util.Scanner; Scanner java.util public class Main { 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int strCount = Integer.parseInt(line[0]);
		int changeNumber = Integer.parseInt(line[1]);
		String target = sc.nextLine();
		
		String result = "";
		for(int i = 0;i<strCount;i++) {
			Character tmp = target.charAt(i);
			if((changeNumber - 1) == i) {
				tmp = tmp.toLowerCase(tmp);
			}
			
			result += tmp;
		}

		
		System.out.println(result);

		
		
		
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int strCount = Integer.parseInt(line[0]);
		int changeNumber = Integer.parseInt(line[1]);
		String target = sc.nextLine();
		
		String result = "";
		for(int i = 0;i<strCount;i++) {
			Character tmp = target.charAt(i);
			if((changeNumber - 1) == i) {
				tmp = tmp.toLowerCase(tmp);
			}
			
			result += tmp;
		}

		
		System.out.println(result);

		
		
		
	} main {
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int strCount = Integer.parseInt(line[0]);
		int changeNumber = Integer.parseInt(line[1]);
		String target = sc.nextLine();
		
		String result = "";
		for(int i = 0;i<strCount;i++) {
			Character tmp = target.charAt(i);
			if((changeNumber - 1) == i) {
				tmp = tmp.toLowerCase(tmp);
			}
			
			result += tmp;
		}

		
		System.out.println(result);

		
		
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] line = sc.nextLine().split(" "); line sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int strCount = Integer.parseInt(line[0]); strCount Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int changeNumber = Integer.parseInt(line[1]); changeNumber Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 String target = sc.nextLine(); target sc.nextLine() sc.nextLine sc String result = ""; result "" for(int i = 0;i<strCount;i++) {
			Character tmp = target.charAt(i);
			if((changeNumber - 1) == i) {
				tmp = tmp.toLowerCase(tmp);
			}
			
			result += tmp;
		} int i = 0; int i = 0; i 0 i<strCount i strCount i++ i++ i {
			Character tmp = target.charAt(i);
			if((changeNumber - 1) == i) {
				tmp = tmp.toLowerCase(tmp);
			}
			
			result += tmp;
		} {
			Character tmp = target.charAt(i);
			if((changeNumber - 1) == i) {
				tmp = tmp.toLowerCase(tmp);
			}
			
			result += tmp;
		} Character tmp = target.charAt(i); tmp target.charAt(i) target.charAt target i if((changeNumber - 1) == i) {
				tmp = tmp.toLowerCase(tmp);
			} (changeNumber - 1) == i (changeNumber - 1) changeNumber 1 i {
				tmp = tmp.toLowerCase(tmp);
			} tmp = tmp.toLowerCase(tmp) tmp tmp.toLowerCase(tmp) tmp.toLowerCase tmp tmp result += tmp result tmp System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main { 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int strCount = Integer.parseInt(line[0]);
		int changeNumber = Integer.parseInt(line[1]);
		String target = sc.nextLine();
		
		String result = "";
		for(int i = 0;i<strCount;i++) {
			Character tmp = target.charAt(i);
			if((changeNumber - 1) == i) {
				tmp = tmp.toLowerCase(tmp);
			}
			
			result += tmp;
		}

		
		System.out.println(result);

		
		
		
	}
} public class Main { 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int strCount = Integer.parseInt(line[0]);
		int changeNumber = Integer.parseInt(line[1]);
		String target = sc.nextLine();
		
		String result = "";
		for(int i = 0;i<strCount;i++) {
			Character tmp = target.charAt(i);
			if((changeNumber - 1) == i) {
				tmp = tmp.toLowerCase(tmp);
			}
			
			result += tmp;
		}

		
		System.out.println(result);

		
		
		
	}
} Main
import java.util.Scanner;

public class Main { 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int strCount = Integer.parseInt(line[0]);
		int changeNumber = Integer.parseInt(line[1]);
		String target = sc.nextLine();
		
		String result = "";
		for(int i = 0;i<strCount;i++) {
			Character tmp = target.charAt(i);
			if((changeNumber - 1) == i) {
				tmp = tmp.toLowerCase(tmp);
			}
			
			result += tmp;
		}

		
		System.out.println(result);

		
		
		
	}
}
	
	