import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Supplier<String> sc) {
		int N = Integer.parseInt(sc.get());
		int K = Integer.parseInt(sc.get()) - 1;
		String S = sc.get();
		char[] chars = S.toCharArray();
		for (int i = 0; i < chars.length; i++) {
			System.out.print((char) (K != i ? chars[i] : chars[i] - 'A' + 'a'));
		}
		System.out.println();
	}
}

class Main {
	public static void main(String... args) {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		Solver.INSTANCE.solve(new Supplier<String>() {
			StringTokenizer line;

			public String get() {
				try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
		});
	}
} Supplier<String>() {
			StringTokenizer line;

			public String get() {
				try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
		} StringTokenizer line; line public String get() {
				try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			} get {
				try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			} try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				} IOException e {
					throw new UncheckedIOException(e);
				} throw new UncheckedIOException(e); new UncheckedIOException(e) {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken(); (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken() (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())) line line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine()) line != null && line.hasMoreTokens() line != null line null line.hasMoreTokens() line.hasMoreTokens line line new StringTokenizer(reader.readLine()) import java.io.*; io.* java import java.util.*; util.* java import java.util.function.*; function.* java.util final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Supplier<String> sc) {
		int N = Integer.parseInt(sc.get());
		int K = Integer.parseInt(sc.get()) - 1;
		String S = sc.get();
		char[] chars = S.toCharArray();
		for (int i = 0; i < chars.length; i++) {
			System.out.print((char) (K != i ? chars[i] : chars[i] - 'A' + 'a'));
		}
		System.out.println();
	}
} Solver static final Solver INSTANCE = new Solver(); INSTANCE new Solver() void solve(Supplier<String> sc) {
		int N = Integer.parseInt(sc.get());
		int K = Integer.parseInt(sc.get()) - 1;
		String S = sc.get();
		char[] chars = S.toCharArray();
		for (int i = 0; i < chars.length; i++) {
			System.out.print((char) (K != i ? chars[i] : chars[i] - 'A' + 'a'));
		}
		System.out.println();
	} solve {
		int N = Integer.parseInt(sc.get());
		int K = Integer.parseInt(sc.get()) - 1;
		String S = sc.get();
		char[] chars = S.toCharArray();
		for (int i = 0; i < chars.length; i++) {
			System.out.print((char) (K != i ? chars[i] : chars[i] - 'A' + 'a'));
		}
		System.out.println();
	} int N = Integer.parseInt(sc.get()); N Integer.parseInt(sc.get()) Integer.parseInt Integer sc.get() sc.get sc int K = Integer.parseInt(sc.get()) - 1; K Integer.parseInt(sc.get()) - 1 Integer.parseInt(sc.get()) Integer.parseInt Integer sc.get() sc.get sc 1 String S = sc.get(); S sc.get() sc.get sc char[] chars = S.toCharArray(); chars S.toCharArray() S.toCharArray S for (int i = 0; i < chars.length; i++) {
			System.out.print((char) (K != i ? chars[i] : chars[i] - 'A' + 'a'));
		} int i = 0; int i = 0; i 0 i < chars.length i chars.length chars chars.length i++ i++ i {
			System.out.print((char) (K != i ? chars[i] : chars[i] - 'A' + 'a'));
		} {
			System.out.print((char) (K != i ? chars[i] : chars[i] - 'A' + 'a'));
		} System.out.print((char) (K != i ? chars[i] : chars[i] - 'A' + 'a')) System.out.print System.out System System.out (char) (K != i ? chars[i] : chars[i] - 'A' + 'a') K != i K i chars[i] chars i chars[i] - 'A' + 'a' chars[i] - 'A' chars[i] chars i 'A' 'a' System.out.println() System.out.println System.out System System.out Supplier<String> sc sc class Main {
	public static void main(String... args) {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		Solver.INSTANCE.solve(new Supplier<String>() {
			StringTokenizer line;

			public String get() {
				try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
		});
	}
} Main public static void main(String... args) {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		Solver.INSTANCE.solve(new Supplier<String>() {
			StringTokenizer line;

			public String get() {
				try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
		});
	} main {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		Solver.INSTANCE.solve(new Supplier<String>() {
			StringTokenizer line;

			public String get() {
				try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
		});
	} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) Solver.INSTANCE.solve(new Supplier<String>() {
			StringTokenizer line;

			public String get() {
				try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
		}) Solver.INSTANCE.solve Solver.INSTANCE Solver Solver.INSTANCE new Supplier<String>() {
			StringTokenizer line;

			public String get() {
				try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
		} String... args args
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Supplier<String> sc) {
		int N = Integer.parseInt(sc.get());
		int K = Integer.parseInt(sc.get()) - 1;
		String S = sc.get();
		char[] chars = S.toCharArray();
		for (int i = 0; i < chars.length; i++) {
			System.out.print((char) (K != i ? chars[i] : chars[i] - 'A' + 'a'));
		}
		System.out.println();
	}
}

class Main {
	public static void main(String... args) {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		Solver.INSTANCE.solve(new Supplier<String>() {
			StringTokenizer line;

			public String get() {
				try {
					return (line = line != null && line.hasMoreTokens() ? line : new StringTokenizer(reader.readLine())).nextToken();
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
		});
	}
}