import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {

		String[] in=br.readLine().split(" ");
		int len=Integer.parseInt(in[0]);
		int order=Integer.parseInt(in[1]);

		String[] str = br.readLine().split("");
		String[] result = new String[len];

		for(int i=0; i<len; i++) {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		}
		String re = "";
		for(String s:result) {
			re=re+s;
		}
		System.out.println(re);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {

		String[] in=br.readLine().split(" ");
		int len=Integer.parseInt(in[0]);
		int order=Integer.parseInt(in[1]);

		String[] str = br.readLine().split("");
		String[] result = new String[len];

		for(int i=0; i<len; i++) {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		}
		String re = "";
		for(String s:result) {
			re=re+s;
		}
		System.out.println(re);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {

		String[] in=br.readLine().split(" ");
		int len=Integer.parseInt(in[0]);
		int order=Integer.parseInt(in[1]);

		String[] str = br.readLine().split("");
		String[] result = new String[len];

		for(int i=0; i<len; i++) {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		}
		String re = "";
		for(String s:result) {
			re=re+s;
		}
		System.out.println(re);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {

		String[] in=br.readLine().split(" ");
		int len=Integer.parseInt(in[0]);
		int order=Integer.parseInt(in[1]);

		String[] str = br.readLine().split("");
		String[] result = new String[len];

		for(int i=0; i<len; i++) {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		}
		String re = "";
		for(String s:result) {
			re=re+s;
		}
		System.out.println(re);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try {

		String[] in=br.readLine().split(" ");
		int len=Integer.parseInt(in[0]);
		int order=Integer.parseInt(in[1]);

		String[] str = br.readLine().split("");
		String[] result = new String[len];

		for(int i=0; i<len; i++) {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		}
		String re = "";
		for(String s:result) {
			re=re+s;
		}
		System.out.println(re);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {

		String[] in=br.readLine().split(" ");
		int len=Integer.parseInt(in[0]);
		int order=Integer.parseInt(in[1]);

		String[] str = br.readLine().split("");
		String[] result = new String[len];

		for(int i=0; i<len; i++) {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		}
		String re = "";
		for(String s:result) {
			re=re+s;
		}
		System.out.println(re);
		} String[] in=br.readLine().split(" "); in br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int len=Integer.parseInt(in[0]); len Integer.parseInt(in[0]) Integer.parseInt Integer in[0] in 0 int order=Integer.parseInt(in[1]); order Integer.parseInt(in[1]) Integer.parseInt Integer in[1] in 1 String[] str = br.readLine().split(""); str br.readLine().split("") br.readLine().split br.readLine() br.readLine br "" String[] result = new String[len]; result new String[len] len for(int i=0; i<len; i++) {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		} int i=0; int i=0; i 0 i<len i len i++ i++ i {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		} {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		} if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			} i==order-1 i order-1 order 1 {
				result[i]=str[i].toLowerCase();
			} result[i]=str[i].toLowerCase() result[i] result i str[i].toLowerCase() str[i].toLowerCase str[i] str i {
				result[i]=str[i];
			} result[i]=str[i] result[i] result i str[i] str i String re = ""; re "" for(String s:result) {
			re=re+s;
		} String s result {
			re=re+s;
		} {
			re=re+s;
		} re=re+s re re+s re s System.out.println(re) System.out.println System.out System System.out re String[] args args public class Main {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {

		String[] in=br.readLine().split(" ");
		int len=Integer.parseInt(in[0]);
		int order=Integer.parseInt(in[1]);

		String[] str = br.readLine().split("");
		String[] result = new String[len];

		for(int i=0; i<len; i++) {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		}
		String re = "";
		for(String s:result) {
			re=re+s;
		}
		System.out.println(re);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} public class Main {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {

		String[] in=br.readLine().split(" ");
		int len=Integer.parseInt(in[0]);
		int order=Integer.parseInt(in[1]);

		String[] str = br.readLine().split("");
		String[] result = new String[len];

		for(int i=0; i<len; i++) {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		}
		String re = "";
		for(String s:result) {
			re=re+s;
		}
		System.out.println(re);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {

		String[] in=br.readLine().split(" ");
		int len=Integer.parseInt(in[0]);
		int order=Integer.parseInt(in[1]);

		String[] str = br.readLine().split("");
		String[] result = new String[len];

		for(int i=0; i<len; i++) {
			if(i==order-1) {
				result[i]=str[i].toLowerCase();
			}else {
				result[i]=str[i];
			}
		}
		String re = "";
		for(String s:result) {
			re=re+s;
		}
		System.out.println(re);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
