import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		String str = sc.next();
		
		String left = str.substring(0, k-1);
		String right = str.substring(k,n);
		
		String low = String.valueOf(str.charAt(k-1));
		low = low.toLowerCase();
		
		System.out.println(left+low+right);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		String str = sc.next();
		
		String left = str.substring(0, k-1);
		String right = str.substring(k,n);
		
		String low = String.valueOf(str.charAt(k-1));
		low = low.toLowerCase();
		
		System.out.println(left+low+right);
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		String str = sc.next();
		
		String left = str.substring(0, k-1);
		String right = str.substring(k,n);
		
		String low = String.valueOf(str.charAt(k-1));
		low = low.toLowerCase();
		
		System.out.println(left+low+right);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		String str = sc.next();
		
		String left = str.substring(0, k-1);
		String right = str.substring(k,n);
		
		String low = String.valueOf(str.charAt(k-1));
		low = low.toLowerCase();
		
		System.out.println(left+low+right);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int k = Integer.parseInt(sc.next()); k Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String str = sc.next(); str sc.next() sc.next sc String left = str.substring(0, k-1); left str.substring(0, k-1) str.substring str 0 k-1 k 1 String right = str.substring(k,n); right str.substring(k,n) str.substring str k n String low = String.valueOf(str.charAt(k-1)); low String.valueOf(str.charAt(k-1)) String.valueOf String str.charAt(k-1) str.charAt str k-1 k 1 low = low.toLowerCase() low low.toLowerCase() low.toLowerCase low System.out.println(left+low+right) System.out.println System.out System System.out left+low+right left+low+right left low right String args[] args public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		String str = sc.next();
		
		String left = str.substring(0, k-1);
		String right = str.substring(k,n);
		
		String low = String.valueOf(str.charAt(k-1));
		low = low.toLowerCase();
		
		System.out.println(left+low+right);
	}
} public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		String str = sc.next();
		
		String left = str.substring(0, k-1);
		String right = str.substring(k,n);
		
		String low = String.valueOf(str.charAt(k-1));
		low = low.toLowerCase();
		
		System.out.println(left+low+right);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int k = Integer.parseInt(sc.next());
		String str = sc.next();
		
		String left = str.substring(0, k-1);
		String right = str.substring(k,n);
		
		String low = String.valueOf(str.charAt(k-1));
		low = low.toLowerCase();
		
		System.out.println(left+low+right);
	}
}
