
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(final String[] args) {
		@SuppressWarnings("resource")
		final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		final int N = in.nextInt();
		final int K = in.nextInt();
		final String S = in.next();
		String R = solve(S, K);
		System.out.println(R);
	}

	public static boolean isPossibleMonth(String m) {
		final int val = Integer.parseInt(m);
		return val <= 12 && val >= 1;
	}

	static String solve(final String S, final int K) {
		final char[] chars = S.toCharArray();
		chars[K - 1] = (char) (chars[K - 1] - 'A' + 'a');
		return new String(chars);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(final String[] args) {
		@SuppressWarnings("resource")
		final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		final int N = in.nextInt();
		final int K = in.nextInt();
		final String S = in.next();
		String R = solve(S, K);
		System.out.println(R);
	}

	public static boolean isPossibleMonth(String m) {
		final int val = Integer.parseInt(m);
		return val <= 12 && val >= 1;
	}

	static String solve(final String S, final int K) {
		final char[] chars = S.toCharArray();
		chars[K - 1] = (char) (chars[K - 1] - 'A' + 'a');
		return new String(chars);
	}
} Main public static void main(final String[] args) {
		@SuppressWarnings("resource")
		final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		final int N = in.nextInt();
		final int K = in.nextInt();
		final String S = in.next();
		String R = solve(S, K);
		System.out.println(R);
	} main {
		@SuppressWarnings("resource")
		final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		final int N = in.nextInt();
		final int K = in.nextInt();
		final String S = in.next();
		String R = solve(S, K);
		System.out.println(R);
	} @SuppressWarnings("resource")
		final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) final int N = in.nextInt(); N in.nextInt() in.nextInt in final int K = in.nextInt(); K in.nextInt() in.nextInt in final String S = in.next(); S in.next() in.next in String R = solve(S, K); R solve(S, K) solve S K System.out.println(R) System.out.println System.out System System.out R final String[] args args public static boolean isPossibleMonth(String m) {
		final int val = Integer.parseInt(m);
		return val <= 12 && val >= 1;
	} isPossibleMonth {
		final int val = Integer.parseInt(m);
		return val <= 12 && val >= 1;
	} final int val = Integer.parseInt(m); val Integer.parseInt(m) Integer.parseInt Integer m return val <= 12 && val >= 1; val <= 12 && val >= 1 val <= 12 val 12 val >= 1 val 1 String m m static String solve(final String S, final int K) {
		final char[] chars = S.toCharArray();
		chars[K - 1] = (char) (chars[K - 1] - 'A' + 'a');
		return new String(chars);
	} solve {
		final char[] chars = S.toCharArray();
		chars[K - 1] = (char) (chars[K - 1] - 'A' + 'a');
		return new String(chars);
	} final char[] chars = S.toCharArray(); chars S.toCharArray() S.toCharArray S chars[K - 1] = (char) (chars[K - 1] - 'A' + 'a') chars[K - 1] chars K - 1 K 1 (char) (chars[K - 1] - 'A' + 'a') chars[K - 1] - 'A' chars[K - 1] chars K - 1 K 1 'A' 'a' return new String(chars); new String(chars) final String S S final int K K public class Main {
	public static void main(final String[] args) {
		@SuppressWarnings("resource")
		final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		final int N = in.nextInt();
		final int K = in.nextInt();
		final String S = in.next();
		String R = solve(S, K);
		System.out.println(R);
	}

	public static boolean isPossibleMonth(String m) {
		final int val = Integer.parseInt(m);
		return val <= 12 && val >= 1;
	}

	static String solve(final String S, final int K) {
		final char[] chars = S.toCharArray();
		chars[K - 1] = (char) (chars[K - 1] - 'A' + 'a');
		return new String(chars);
	}
} public class Main {
	public static void main(final String[] args) {
		@SuppressWarnings("resource")
		final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		final int N = in.nextInt();
		final int K = in.nextInt();
		final String S = in.next();
		String R = solve(S, K);
		System.out.println(R);
	}

	public static boolean isPossibleMonth(String m) {
		final int val = Integer.parseInt(m);
		return val <= 12 && val >= 1;
	}

	static String solve(final String S, final int K) {
		final char[] chars = S.toCharArray();
		chars[K - 1] = (char) (chars[K - 1] - 'A' + 'a');
		return new String(chars);
	}
} Main

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(final String[] args) {
		@SuppressWarnings("resource")
		final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		final int N = in.nextInt();
		final int K = in.nextInt();
		final String S = in.next();
		String R = solve(S, K);
		System.out.println(R);
	}

	public static boolean isPossibleMonth(String m) {
		final int val = Integer.parseInt(m);
		return val <= 12 && val >= 1;
	}

	static String solve(final String S, final int K) {
		final char[] chars = S.toCharArray();
		chars[K - 1] = (char) (chars[K - 1] - 'A' + 'a');
		return new String(chars);
	}
}
