import java.util.Scanner;

class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力

		int n = sc.nextInt();
		int k = sc.nextInt()-1;
		String str = sc.next();
		
		StringBuffer sb = new StringBuffer(str);
		char cc = str.toLowerCase().charAt(k);
		sb.setCharAt(k, cc);
		System.out.print(sb.toString());
		
		
		
		
	}
	
	
	static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}
	




static String deletestr(String base,String remove){
	boolean flag = true;
	for(int i = 0;i < remove.length();i++){
		if(i == base.length()){
			flag = false;
			break;
		}
		if(base.charAt(i) - remove.charAt(i) != 0 && base.charAt(i) - remove.charAt(i) != 32 &&remove.charAt(i) - base.charAt(i)  != 32){
			flag = false;
			break;
		}
	}

	if(flag){
		base = base.substring(remove.length());
	}

	return base;

}



}


class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	}
}

 import java.util.Scanner; Scanner java.util class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力

		int n = sc.nextInt();
		int k = sc.nextInt()-1;
		String str = sc.next();
		
		StringBuffer sb = new StringBuffer(str);
		char cc = str.toLowerCase().charAt(k);
		sb.setCharAt(k, cc);
		System.out.print(sb.toString());
		
		
		
		
	}
	
	
	static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}
	




static String deletestr(String base,String remove){
	boolean flag = true;
	for(int i = 0;i < remove.length();i++){
		if(i == base.length()){
			flag = false;
			break;
		}
		if(base.charAt(i) - remove.charAt(i) != 0 && base.charAt(i) - remove.charAt(i) != 32 &&remove.charAt(i) - base.charAt(i)  != 32){
			flag = false;
			break;
		}
	}

	if(flag){
		base = base.substring(remove.length());
	}

	return base;

}



} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力

		int n = sc.nextInt();
		int k = sc.nextInt()-1;
		String str = sc.next();
		
		StringBuffer sb = new StringBuffer(str);
		char cc = str.toLowerCase().charAt(k);
		sb.setCharAt(k, cc);
		System.out.print(sb.toString());
		
		
		
		
	} main {
		Scanner sc = new Scanner(System.in);			//文字の入力

		int n = sc.nextInt();
		int k = sc.nextInt()-1;
		String str = sc.next();
		
		StringBuffer sb = new StringBuffer(str);
		char cc = str.toLowerCase().charAt(k);
		sb.setCharAt(k, cc);
		System.out.print(sb.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 str = sc.next(); str sc.next() sc.next sc StringBuffer sb = new StringBuffer(str); sb new StringBuffer(str) char cc = str.toLowerCase().charAt(k); cc str.toLowerCase().charAt(k) str.toLowerCase().charAt str.toLowerCase() str.toLowerCase str k sb.setCharAt(k, cc) sb.setCharAt sb k cc System.out.print(sb.toString()) System.out.print System.out System System.out sb.toString() sb.toString sb String[] args args static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	} gcd {				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	} if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		} b == 0 b 0 {
			return a;
		} return a; a {
			return gcd(b, a%b);
		} return gcd(b, a%b); gcd(b, a%b) gcd b a%b a b int a a int b b static String deletestr(String base,String remove){
	boolean flag = true;
	for(int i = 0;i < remove.length();i++){
		if(i == base.length()){
			flag = false;
			break;
		}
		if(base.charAt(i) - remove.charAt(i) != 0 && base.charAt(i) - remove.charAt(i) != 32 &&remove.charAt(i) - base.charAt(i)  != 32){
			flag = false;
			break;
		}
	}

	if(flag){
		base = base.substring(remove.length());
	}

	return base;

} deletestr {
	boolean flag = true;
	for(int i = 0;i < remove.length();i++){
		if(i == base.length()){
			flag = false;
			break;
		}
		if(base.charAt(i) - remove.charAt(i) != 0 && base.charAt(i) - remove.charAt(i) != 32 &&remove.charAt(i) - base.charAt(i)  != 32){
			flag = false;
			break;
		}
	}

	if(flag){
		base = base.substring(remove.length());
	}

	return base;

} boolean flag = true; flag true for(int i = 0;i < remove.length();i++){
		if(i == base.length()){
			flag = false;
			break;
		}
		if(base.charAt(i) - remove.charAt(i) != 0 && base.charAt(i) - remove.charAt(i) != 32 &&remove.charAt(i) - base.charAt(i)  != 32){
			flag = false;
			break;
		}
	} int i = 0; int i = 0; i 0 i < remove.length() i remove.length() remove.length remove i++ i++ i {
		if(i == base.length()){
			flag = false;
			break;
		}
		if(base.charAt(i) - remove.charAt(i) != 0 && base.charAt(i) - remove.charAt(i) != 32 &&remove.charAt(i) - base.charAt(i)  != 32){
			flag = false;
			break;
		}
	} {
		if(i == base.length()){
			flag = false;
			break;
		}
		if(base.charAt(i) - remove.charAt(i) != 0 && base.charAt(i) - remove.charAt(i) != 32 &&remove.charAt(i) - base.charAt(i)  != 32){
			flag = false;
			break;
		}
	} if(i == base.length()){
			flag = false;
			break;
		} i == base.length() i base.length() base.length base {
			flag = false;
			break;
		} flag = false flag false break; if(base.charAt(i) - remove.charAt(i) != 0 && base.charAt(i) - remove.charAt(i) != 32 &&remove.charAt(i) - base.charAt(i)  != 32){
			flag = false;
			break;
		} base.charAt(i) - remove.charAt(i) != 0 && base.charAt(i) - remove.charAt(i) != 32 &&remove.charAt(i) - base.charAt(i)  != 32 base.charAt(i) - remove.charAt(i) != 0 && base.charAt(i) - remove.charAt(i) != 32 &&remove.charAt(i) - base.charAt(i)  != 32 base.charAt(i) - remove.charAt(i) != 0 base.charAt(i) - remove.charAt(i) base.charAt(i) base.charAt base i remove.charAt(i) remove.charAt remove i 0 base.charAt(i) - remove.charAt(i) != 32 base.charAt(i) - remove.charAt(i) base.charAt(i) base.charAt base i remove.charAt(i) remove.charAt remove i 32 remove.charAt(i) - base.charAt(i)  != 32 remove.charAt(i) - base.charAt(i) remove.charAt(i) remove.charAt remove i base.charAt(i) base.charAt base i 32 {
			flag = false;
			break;
		} flag = false flag false break; if(flag){
		base = base.substring(remove.length());
	} flag {
		base = base.substring(remove.length());
	} base = base.substring(remove.length()) base base.substring(remove.length()) base.substring base remove.length() remove.length remove return base; base String base base String remove remove class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	}
} Pair int from; from int end; end @Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	} compareTo {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	} Pair otherpair = (Pair)other; otherpair (Pair)other return from - otherpair.from; from - otherpair.from from otherpair.from otherpair otherpair.from Object other other Comparable
import java.util.Scanner;

class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力

		int n = sc.nextInt();
		int k = sc.nextInt()-1;
		String str = sc.next();
		
		StringBuffer sb = new StringBuffer(str);
		char cc = str.toLowerCase().charAt(k);
		sb.setCharAt(k, cc);
		System.out.print(sb.toString());
		
		
		
		
	}
	
	
	static int gcd(int a,int b){				//最大公約数を返す
		if(b == 0){
			return a;
		}else{
			return gcd(b, a%b);
		}
	}
	




static String deletestr(String base,String remove){
	boolean flag = true;
	for(int i = 0;i < remove.length();i++){
		if(i == base.length()){
			flag = false;
			break;
		}
		if(base.charAt(i) - remove.charAt(i) != 0 && base.charAt(i) - remove.charAt(i) != 32 &&remove.charAt(i) - base.charAt(i)  != 32){
			flag = false;
			break;
		}
	}

	if(flag){
		base = base.substring(remove.length());
	}

	return base;

}



}


class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	}
}


