import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt(),K=sc.nextInt();
		char[] s=sc.next().toCharArray();
		for (int i=0; i<N; i++) {
			System.out.print(i==K-1?Character.toLowerCase(s[i]):s[i]);
		}
		System.out.println();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt(),K=sc.nextInt();
		char[] s=sc.next().toCharArray();
		for (int i=0; i<N; i++) {
			System.out.print(i==K-1?Character.toLowerCase(s[i]):s[i]);
		}
		System.out.println();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt(),K=sc.nextInt();
		char[] s=sc.next().toCharArray();
		for (int i=0; i<N; i++) {
			System.out.print(i==K-1?Character.toLowerCase(s[i]):s[i]);
		}
		System.out.println();
	} main {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt(),K=sc.nextInt();
		char[] s=sc.next().toCharArray();
		for (int i=0; i<N; i++) {
			System.out.print(i==K-1?Character.toLowerCase(s[i]):s[i]);
		}
		System.out.println();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N=sc.nextInt() N sc.nextInt() sc.nextInt sc K=sc.nextInt(); K sc.nextInt() sc.nextInt sc char[] s=sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc for (int i=0; i<N; i++) {
			System.out.print(i==K-1?Character.toLowerCase(s[i]):s[i]);
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			System.out.print(i==K-1?Character.toLowerCase(s[i]):s[i]);
		} {
			System.out.print(i==K-1?Character.toLowerCase(s[i]):s[i]);
		} System.out.print(i==K-1?Character.toLowerCase(s[i]):s[i]) System.out.print System.out System System.out i==K-1?Character.toLowerCase(s[i]):s[i] i==K-1 i K-1 K 1 Character.toLowerCase(s[i]) Character.toLowerCase Character s[i] s i s[i] s i System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt(),K=sc.nextInt();
		char[] s=sc.next().toCharArray();
		for (int i=0; i<N; i++) {
			System.out.print(i==K-1?Character.toLowerCase(s[i]):s[i]);
		}
		System.out.println();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt(),K=sc.nextInt();
		char[] s=sc.next().toCharArray();
		for (int i=0; i<N; i++) {
			System.out.print(i==K-1?Character.toLowerCase(s[i]):s[i]);
		}
		System.out.println();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt(),K=sc.nextInt();
		char[] s=sc.next().toCharArray();
		for (int i=0; i<N; i++) {
			System.out.print(i==K-1?Character.toLowerCase(s[i]):s[i]);
		}
		System.out.println();
	}
}
