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();
		String s = sc.next();

		String ans = s.substring(0, k - 1);
		ans += Character.toLowerCase(s.charAt(k - 1));
		ans += s.substring(k);

		System.out.println(ans);

		sc.close();
	}
} 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();
		String s = sc.next();

		String ans = s.substring(0, k - 1);
		ans += Character.toLowerCase(s.charAt(k - 1));
		ans += s.substring(k);

		System.out.println(ans);

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();

		String ans = s.substring(0, k - 1);
		ans += Character.toLowerCase(s.charAt(k - 1));
		ans += s.substring(k);

		System.out.println(ans);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();

		String ans = s.substring(0, k - 1);
		ans += Character.toLowerCase(s.charAt(k - 1));
		ans += s.substring(k);

		System.out.println(ans);

		sc.close();
	} 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 s = sc.next(); s sc.next() sc.next sc String ans = s.substring(0, k - 1); ans s.substring(0, k - 1) s.substring s 0 k - 1 k 1 ans += Character.toLowerCase(s.charAt(k - 1)) ans Character.toLowerCase(s.charAt(k - 1)) Character.toLowerCase Character s.charAt(k - 1) s.charAt s k - 1 k 1 ans += s.substring(k) ans s.substring(k) s.substring s k System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args
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();
		String s = sc.next();

		String ans = s.substring(0, k - 1);
		ans += Character.toLowerCase(s.charAt(k - 1));
		ans += s.substring(k);

		System.out.println(ans);

		sc.close();
	}
}
