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

public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// System.setOut(obj);

		int N = sc.nextInt();
		int K = sc.nextInt();

		String S = sc.next();

		StringBuffer str = new StringBuffer(S);

		int index = K - 1;

		for(int i = 0;i<N;i++)
		{
			Character c = str.charAt(i);

			if(i == index)
			{
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			}
		}

		System.out.println(str);
		
		sc.close();
		System.out.flush();
	}
} import java.io.*; io.* java import java.util.*; util.* java import java.lang.*; lang.* java public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// System.setOut(obj);

		int N = sc.nextInt();
		int K = sc.nextInt();

		String S = sc.next();

		StringBuffer str = new StringBuffer(S);

		int index = K - 1;

		for(int i = 0;i<N;i++)
		{
			Character c = str.charAt(i);

			if(i == index)
			{
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			}
		}

		System.out.println(str);
		
		sc.close();
		System.out.flush();
	}
} Main public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// System.setOut(obj);

		int N = sc.nextInt();
		int K = sc.nextInt();

		String S = sc.next();

		StringBuffer str = new StringBuffer(S);

		int index = K - 1;

		for(int i = 0;i<N;i++)
		{
			Character c = str.charAt(i);

			if(i == index)
			{
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			}
		}

		System.out.println(str);
		
		sc.close();
		System.out.flush();
	} main {
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// System.setOut(obj);

		int N = sc.nextInt();
		int K = sc.nextInt();

		String S = sc.next();

		StringBuffer str = new StringBuffer(S);

		int index = K - 1;

		for(int i = 0;i<N;i++)
		{
			Character c = str.charAt(i);

			if(i == index)
			{
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			}
		}

		System.out.println(str);
		
		sc.close();
		System.out.flush();
	} 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 StringBuffer str = new StringBuffer(S); str new StringBuffer(S) int index = K - 1; index K - 1 K 1 for(int i = 0;i<N;i++)
		{
			Character c = str.charAt(i);

			if(i == index)
			{
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			}
		} int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
			Character c = str.charAt(i);

			if(i == index)
			{
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			}
		} {
			Character c = str.charAt(i);

			if(i == index)
			{
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			}
		} Character c = str.charAt(i); c str.charAt(i) str.charAt str i if(i == index)
			{
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			} i == index i index {
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			} str.replace(i,i+1,Character.toLowerCase(c)+"") str.replace str i i+1 i 1 Character.toLowerCase(c)+"" Character.toLowerCase(c) Character.toLowerCase Character c "" System.out.println(str) System.out.println System.out System System.out str sc.close() sc.close sc System.out.flush() System.out.flush System.out System System.out String args[] args public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// System.setOut(obj);

		int N = sc.nextInt();
		int K = sc.nextInt();

		String S = sc.next();

		StringBuffer str = new StringBuffer(S);

		int index = K - 1;

		for(int i = 0;i<N;i++)
		{
			Character c = str.charAt(i);

			if(i == index)
			{
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			}
		}

		System.out.println(str);
		
		sc.close();
		System.out.flush();
	}
} public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// System.setOut(obj);

		int N = sc.nextInt();
		int K = sc.nextInt();

		String S = sc.next();

		StringBuffer str = new StringBuffer(S);

		int index = K - 1;

		for(int i = 0;i<N;i++)
		{
			Character c = str.charAt(i);

			if(i == index)
			{
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			}
		}

		System.out.println(str);
		
		sc.close();
		System.out.flush();
	}
} Main
import java.io.*;
import java.util.*;
import java.lang.*;

public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);

		// PrintStream obj = new PrintStream(new File("Output.txt"));
		// System.setOut(obj);

		int N = sc.nextInt();
		int K = sc.nextInt();

		String S = sc.next();

		StringBuffer str = new StringBuffer(S);

		int index = K - 1;

		for(int i = 0;i<N;i++)
		{
			Character c = str.charAt(i);

			if(i == index)
			{
				str.replace(i,i+1,Character.toLowerCase(c)+"");
			}
		}

		System.out.println(str);
		
		sc.close();
		System.out.flush();
	}
}