import 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();
      	int i ;
     
  		String[] str = s.split("");
		String temp = str[k-1];
      
      	String  answer[] = new String[n] ;
	
      	for(i = 0; i <= n-1 ; i++){
        	if(i == k-1){
              	answer[i] = temp.toLowerCase();
            }else{
              	answer[i] = str[i];
        	}
        }
      	String r = String.join("", answer);
      	System.out.println(r);
	}
} import java.util.*; util.* java 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();
      	int i ;
     
  		String[] str = s.split("");
		String temp = str[k-1];
      
      	String  answer[] = new String[n] ;
	
      	for(i = 0; i <= n-1 ; i++){
        	if(i == k-1){
              	answer[i] = temp.toLowerCase();
            }else{
              	answer[i] = str[i];
        	}
        }
      	String r = String.join("", answer);
      	System.out.println(r);
	}
} 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();
      	int i ;
     
  		String[] str = s.split("");
		String temp = str[k-1];
      
      	String  answer[] = new String[n] ;
	
      	for(i = 0; i <= n-1 ; i++){
        	if(i == k-1){
              	answer[i] = temp.toLowerCase();
            }else{
              	answer[i] = str[i];
        	}
        }
      	String r = String.join("", answer);
      	System.out.println(r);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt() ;
		int k = sc.nextInt();
		String s = sc.next();
      	int i ;
     
  		String[] str = s.split("");
		String temp = str[k-1];
      
      	String  answer[] = new String[n] ;
	
      	for(i = 0; i <= n-1 ; i++){
        	if(i == k-1){
              	answer[i] = temp.toLowerCase();
            }else{
              	answer[i] = str[i];
        	}
        }
      	String r = String.join("", answer);
      	System.out.println(r);
	} 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 int i ; i String[] str = s.split(""); str s.split("") s.split s "" String temp = str[k-1]; temp str[k-1] str k-1 k 1 String  answer[] = new String[n] ; answer new String[n] n for(i = 0; i <= n-1 ; i++){
        	if(i == k-1){
              	answer[i] = temp.toLowerCase();
            }else{
              	answer[i] = str[i];
        	}
        } i = 0; i = 0 i 0 i <= n-1 i n-1 n 1 i++ i++ i {
        	if(i == k-1){
              	answer[i] = temp.toLowerCase();
            }else{
              	answer[i] = str[i];
        	}
        } {
        	if(i == k-1){
              	answer[i] = temp.toLowerCase();
            }else{
              	answer[i] = str[i];
        	}
        } if(i == k-1){
              	answer[i] = temp.toLowerCase();
            }else{
              	answer[i] = str[i];
        	} i == k-1 i k-1 k 1 {
              	answer[i] = temp.toLowerCase();
            } answer[i] = temp.toLowerCase() answer[i] answer i temp.toLowerCase() temp.toLowerCase temp {
              	answer[i] = str[i];
        	} answer[i] = str[i] answer[i] answer i str[i] str i String r = String.join("", answer); r String.join("", answer) String.join String "" answer System.out.println(r) System.out.println System.out System System.out r 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();
      	int i ;
     
  		String[] str = s.split("");
		String temp = str[k-1];
      
      	String  answer[] = new String[n] ;
	
      	for(i = 0; i <= n-1 ; i++){
        	if(i == k-1){
              	answer[i] = temp.toLowerCase();
            }else{
              	answer[i] = str[i];
        	}
        }
      	String r = String.join("", answer);
      	System.out.println(r);
	}
} 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();
      	int i ;
     
  		String[] str = s.split("");
		String temp = str[k-1];
      
      	String  answer[] = new String[n] ;
	
      	for(i = 0; i <= n-1 ; i++){
        	if(i == k-1){
              	answer[i] = temp.toLowerCase();
            }else{
              	answer[i] = str[i];
        	}
        }
      	String r = String.join("", answer);
      	System.out.println(r);
	}
} Main
import 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();
      	int i ;
     
  		String[] str = s.split("");
		String temp = str[k-1];
      
      	String  answer[] = new String[n] ;
	
      	for(i = 0; i <= n-1 ; i++){
        	if(i == k-1){
              	answer[i] = temp.toLowerCase();
            }else{
              	answer[i] = str[i];
        	}
        }
      	String r = String.join("", answer);
      	System.out.println(r);
	}
}