import java.util.Scanner;


class Solve{
	static int INF = 10000;
	
	 public void solve() {
		 Scanner sc = new Scanner(System.in) ;
		 int n = sc.nextInt();
		 int k = sc.nextInt();
		 String str = sc.next();
		 StringBuilder sb = new StringBuilder(str);
		 if(str.charAt(k-1)=='A') {
			 sb.replace(k-1, k, "a");
		 }else if(str.charAt(k-1)=='B') {
			 sb.replace(k-1, k, "b");
		 }
		 else if(str.charAt(k-1)=='C') {
			 sb.replace(k-1, k, "c");
		 }
		 System.out.println(sb);

	}
}





public class Main {

	public static void main(String[] args) {

		Solve s= new Solve();
		s.solve();

	}
} import java.util.Scanner; Scanner java.util class Solve{
	static int INF = 10000;
	
	 public void solve() {
		 Scanner sc = new Scanner(System.in) ;
		 int n = sc.nextInt();
		 int k = sc.nextInt();
		 String str = sc.next();
		 StringBuilder sb = new StringBuilder(str);
		 if(str.charAt(k-1)=='A') {
			 sb.replace(k-1, k, "a");
		 }else if(str.charAt(k-1)=='B') {
			 sb.replace(k-1, k, "b");
		 }
		 else if(str.charAt(k-1)=='C') {
			 sb.replace(k-1, k, "c");
		 }
		 System.out.println(sb);

	}
} Solve static int INF = 10000; INF 10000 public void solve() {
		 Scanner sc = new Scanner(System.in) ;
		 int n = sc.nextInt();
		 int k = sc.nextInt();
		 String str = sc.next();
		 StringBuilder sb = new StringBuilder(str);
		 if(str.charAt(k-1)=='A') {
			 sb.replace(k-1, k, "a");
		 }else if(str.charAt(k-1)=='B') {
			 sb.replace(k-1, k, "b");
		 }
		 else if(str.charAt(k-1)=='C') {
			 sb.replace(k-1, k, "c");
		 }
		 System.out.println(sb);

	} solve {
		 Scanner sc = new Scanner(System.in) ;
		 int n = sc.nextInt();
		 int k = sc.nextInt();
		 String str = sc.next();
		 StringBuilder sb = new StringBuilder(str);
		 if(str.charAt(k-1)=='A') {
			 sb.replace(k-1, k, "a");
		 }else if(str.charAt(k-1)=='B') {
			 sb.replace(k-1, k, "b");
		 }
		 else if(str.charAt(k-1)=='C') {
			 sb.replace(k-1, k, "c");
		 }
		 System.out.println(sb);

	} 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(); k sc.nextInt() sc.nextInt sc String str = sc.next(); str sc.next() sc.next sc StringBuilder sb = new StringBuilder(str); sb new StringBuilder(str) if(str.charAt(k-1)=='A') {
			 sb.replace(k-1, k, "a");
		 }else if(str.charAt(k-1)=='B') {
			 sb.replace(k-1, k, "b");
		 }
		 else if(str.charAt(k-1)=='C') {
			 sb.replace(k-1, k, "c");
		 } str.charAt(k-1)=='A' str.charAt(k-1) str.charAt str k-1 k 1 'A' {
			 sb.replace(k-1, k, "a");
		 } sb.replace(k-1, k, "a") sb.replace sb k-1 k 1 k "a" if(str.charAt(k-1)=='B') {
			 sb.replace(k-1, k, "b");
		 }
		 else if(str.charAt(k-1)=='C') {
			 sb.replace(k-1, k, "c");
		 } str.charAt(k-1)=='B' str.charAt(k-1) str.charAt str k-1 k 1 'B' {
			 sb.replace(k-1, k, "b");
		 } sb.replace(k-1, k, "b") sb.replace sb k-1 k 1 k "b" if(str.charAt(k-1)=='C') {
			 sb.replace(k-1, k, "c");
		 } str.charAt(k-1)=='C' str.charAt(k-1) str.charAt str k-1 k 1 'C' {
			 sb.replace(k-1, k, "c");
		 } sb.replace(k-1, k, "c") sb.replace sb k-1 k 1 k "c" System.out.println(sb) System.out.println System.out System System.out sb public class Main {

	public static void main(String[] args) {

		Solve s= new Solve();
		s.solve();

	}
} Main public static void main(String[] args) {

		Solve s= new Solve();
		s.solve();

	} main {

		Solve s= new Solve();
		s.solve();

	} Solve s= new Solve(); s new Solve() s.solve() s.solve s String[] args args public class Main {

	public static void main(String[] args) {

		Solve s= new Solve();
		s.solve();

	}
} public class Main {

	public static void main(String[] args) {

		Solve s= new Solve();
		s.solve();

	}
} Main
import java.util.Scanner;


class Solve{
	static int INF = 10000;
	
	 public void solve() {
		 Scanner sc = new Scanner(System.in) ;
		 int n = sc.nextInt();
		 int k = sc.nextInt();
		 String str = sc.next();
		 StringBuilder sb = new StringBuilder(str);
		 if(str.charAt(k-1)=='A') {
			 sb.replace(k-1, k, "a");
		 }else if(str.charAt(k-1)=='B') {
			 sb.replace(k-1, k, "b");
		 }
		 else if(str.charAt(k-1)=='C') {
			 sb.replace(k-1, k, "c");
		 }
		 System.out.println(sb);

	}
}





public class Main {

	public static void main(String[] args) {

		Solve s= new Solve();
		s.solve();

	}
}
