import java.util.Locale;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int k=scan.nextInt();
		scan.nextLine();
		String s= scan.nextLine();
		String t="";
		for(int i=0;i<n;i++) {
			if(i==k-1) {
			t+=s.toLowerCase().charAt(i);
			}
			else {
				t+=s.charAt(i);
			}
		}
		System.out.println(t);
	

}
} import java.util.Locale; Locale java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int k=scan.nextInt();
		scan.nextLine();
		String s= scan.nextLine();
		String t="";
		for(int i=0;i<n;i++) {
			if(i==k-1) {
			t+=s.toLowerCase().charAt(i);
			}
			else {
				t+=s.charAt(i);
			}
		}
		System.out.println(t);
	

}
} Main public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int k=scan.nextInt();
		scan.nextLine();
		String s= scan.nextLine();
		String t="";
		for(int i=0;i<n;i++) {
			if(i==k-1) {
			t+=s.toLowerCase().charAt(i);
			}
			else {
				t+=s.charAt(i);
			}
		}
		System.out.println(t);
	

} main {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int k=scan.nextInt();
		scan.nextLine();
		String s= scan.nextLine();
		String t="";
		for(int i=0;i<n;i++) {
			if(i==k-1) {
			t+=s.toLowerCase().charAt(i);
			}
			else {
				t+=s.charAt(i);
			}
		}
		System.out.println(t);
	

} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int n=scan.nextInt(); n scan.nextInt() scan.nextInt scan int k=scan.nextInt(); k scan.nextInt() scan.nextInt scan scan.nextLine() scan.nextLine scan String s= scan.nextLine(); s scan.nextLine() scan.nextLine scan String t=""; t "" for(int i=0;i<n;i++) {
			if(i==k-1) {
			t+=s.toLowerCase().charAt(i);
			}
			else {
				t+=s.charAt(i);
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			if(i==k-1) {
			t+=s.toLowerCase().charAt(i);
			}
			else {
				t+=s.charAt(i);
			}
		} {
			if(i==k-1) {
			t+=s.toLowerCase().charAt(i);
			}
			else {
				t+=s.charAt(i);
			}
		} if(i==k-1) {
			t+=s.toLowerCase().charAt(i);
			}
			else {
				t+=s.charAt(i);
			} i==k-1 i k-1 k 1 {
			t+=s.toLowerCase().charAt(i);
			} t+=s.toLowerCase().charAt(i) t s.toLowerCase().charAt(i) s.toLowerCase().charAt s.toLowerCase() s.toLowerCase s i {
				t+=s.charAt(i);
			} t+=s.charAt(i) t s.charAt(i) s.charAt s i System.out.println(t) System.out.println System.out System System.out t String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int k=scan.nextInt();
		scan.nextLine();
		String s= scan.nextLine();
		String t="";
		for(int i=0;i<n;i++) {
			if(i==k-1) {
			t+=s.toLowerCase().charAt(i);
			}
			else {
				t+=s.charAt(i);
			}
		}
		System.out.println(t);
	

}
} public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int k=scan.nextInt();
		scan.nextLine();
		String s= scan.nextLine();
		String t="";
		for(int i=0;i<n;i++) {
			if(i==k-1) {
			t+=s.toLowerCase().charAt(i);
			}
			else {
				t+=s.charAt(i);
			}
		}
		System.out.println(t);
	

}
} Main
import java.util.Locale;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int k=scan.nextInt();
		scan.nextLine();
		String s= scan.nextLine();
		String t="";
		for(int i=0;i<n;i++) {
			if(i==k-1) {
			t+=s.toLowerCase().charAt(i);
			}
			else {
				t+=s.charAt(i);
			}
		}
		System.out.println(t);
	

}
}