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

class Main {

	void solve () {

		int n = in.nextInt(), k = in.nextInt();
		char[] s = in.next().toCharArray();
		s[k-1] = Character.toLowerCase(s[k-1]);
		out.println(String.valueOf(s));
		
	}
	
	public static Scanner in = new Scanner(System.in);
	public static PrintWriter out = new PrintWriter(System.out);
	public static void main(String[] args) {
		new Main().solve();
		out.flush();
	}

} import java.util.*; util.* java import java.io.*; io.* java class Main {

	void solve () {

		int n = in.nextInt(), k = in.nextInt();
		char[] s = in.next().toCharArray();
		s[k-1] = Character.toLowerCase(s[k-1]);
		out.println(String.valueOf(s));
		
	}
	
	public static Scanner in = new Scanner(System.in);
	public static PrintWriter out = new PrintWriter(System.out);
	public static void main(String[] args) {
		new Main().solve();
		out.flush();
	}

} Main public static Scanner in = new Scanner(System.in); in new Scanner(System.in) public static PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) void solve () {

		int n = in.nextInt(), k = in.nextInt();
		char[] s = in.next().toCharArray();
		s[k-1] = Character.toLowerCase(s[k-1]);
		out.println(String.valueOf(s));
		
	} solve {

		int n = in.nextInt(), k = in.nextInt();
		char[] s = in.next().toCharArray();
		s[k-1] = Character.toLowerCase(s[k-1]);
		out.println(String.valueOf(s));
		
	} int n = in.nextInt() n in.nextInt() in.nextInt in k = in.nextInt(); k in.nextInt() in.nextInt in char[] s = in.next().toCharArray(); s in.next().toCharArray() in.next().toCharArray in.next() in.next in s[k-1] = Character.toLowerCase(s[k-1]) s[k-1] s k-1 k 1 Character.toLowerCase(s[k-1]) Character.toLowerCase Character s[k-1] s k-1 k 1 out.println(String.valueOf(s)) out.println out String.valueOf(s) String.valueOf String s public static void main(String[] args) {
		new Main().solve();
		out.flush();
	} main {
		new Main().solve();
		out.flush();
	} new Main().solve() new Main().solve new Main() out.flush() out.flush out String[] args args
import java.util.*;
import java.io.*;

class Main {

	void solve () {

		int n = in.nextInt(), k = in.nextInt();
		char[] s = in.next().toCharArray();
		s[k-1] = Character.toLowerCase(s[k-1]);
		out.println(String.valueOf(s));
		
	}
	
	public static Scanner in = new Scanner(System.in);
	public static PrintWriter out = new PrintWriter(System.out);
	public static void main(String[] args) {
		new Main().solve();
		out.flush();
	}

}