import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();
		StringBuilder newS = new StringBuilder();
		newS.append(s.substring(0, k-1));
		newS.append(s.substring(k - 1, k).toLowerCase());
		newS.append(s.substring(k));
		
		System.out.println(newS);
	}	
} import java.util.Scanner; Scanner java.util public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();
		StringBuilder newS = new StringBuilder();
		newS.append(s.substring(0, k-1));
		newS.append(s.substring(k - 1, k).toLowerCase());
		newS.append(s.substring(k));
		
		System.out.println(newS);
	}	
} Main public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();
		StringBuilder newS = new StringBuilder();
		newS.append(s.substring(0, k-1));
		newS.append(s.substring(k - 1, k).toLowerCase());
		newS.append(s.substring(k));
		
		System.out.println(newS);
	} main {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();
		StringBuilder newS = new StringBuilder();
		newS.append(s.substring(0, k-1));
		newS.append(s.substring(k - 1, k).toLowerCase());
		newS.append(s.substring(k));
		
		System.out.println(newS);
	} 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 StringBuilder newS = new StringBuilder(); newS new StringBuilder() newS.append(s.substring(0, k-1)) newS.append newS s.substring(0, k-1) s.substring s 0 k-1 k 1 newS.append(s.substring(k - 1, k).toLowerCase()) newS.append newS s.substring(k - 1, k).toLowerCase() s.substring(k - 1, k).toLowerCase s.substring(k - 1, k) s.substring s k - 1 k 1 k newS.append(s.substring(k)) newS.append newS s.substring(k) s.substring s k System.out.println(newS) System.out.println System.out System System.out newS String[] args args public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();
		StringBuilder newS = new StringBuilder();
		newS.append(s.substring(0, k-1));
		newS.append(s.substring(k - 1, k).toLowerCase());
		newS.append(s.substring(k));
		
		System.out.println(newS);
	}	
} public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();
		StringBuilder newS = new StringBuilder();
		newS.append(s.substring(0, k-1));
		newS.append(s.substring(k - 1, k).toLowerCase());
		newS.append(s.substring(k));
		
		System.out.println(newS);
	}	
} Main
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		String s = sc.next();
		StringBuilder newS = new StringBuilder();
		newS.append(s.substring(0, k-1));
		newS.append(s.substring(k - 1, k).toLowerCase());
		newS.append(s.substring(k));
		
		System.out.println(newS);
	}	
}