import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      int N = sc.nextInt();
      int K = sc.nextInt();
      String S = sc.next();
      String output = "";
      for(int i = 0; i < N; i++){
        if(i + 1 == K){
          output += S.substring(i , i + 1).toLowerCase();
        }else{
          output += S.substring(i , i + 1);
        }
      }
      System.out.println(output);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      int N = sc.nextInt();
      int K = sc.nextInt();
      String S = sc.next();
      String output = "";
      for(int i = 0; i < N; i++){
        if(i + 1 == K){
          output += S.substring(i , i + 1).toLowerCase();
        }else{
          output += S.substring(i , i + 1);
        }
      }
      System.out.println(output);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      int N = sc.nextInt();
      int K = sc.nextInt();
      String S = sc.next();
      String output = "";
      for(int i = 0; i < N; i++){
        if(i + 1 == K){
          output += S.substring(i , i + 1).toLowerCase();
        }else{
          output += S.substring(i , i + 1);
        }
      }
      System.out.println(output);
	} main {
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      int N = sc.nextInt();
      int K = sc.nextInt();
      String S = sc.next();
      String output = "";
      for(int i = 0; i < N; i++){
        if(i + 1 == K){
          output += S.substring(i , i + 1).toLowerCase();
        }else{
          output += S.substring(i , i + 1);
        }
      }
      System.out.println(output);
	} 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 String output = ""; output "" for(int i = 0; i < N; i++){
        if(i + 1 == K){
          output += S.substring(i , i + 1).toLowerCase();
        }else{
          output += S.substring(i , i + 1);
        }
      } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
        if(i + 1 == K){
          output += S.substring(i , i + 1).toLowerCase();
        }else{
          output += S.substring(i , i + 1);
        }
      } {
        if(i + 1 == K){
          output += S.substring(i , i + 1).toLowerCase();
        }else{
          output += S.substring(i , i + 1);
        }
      } if(i + 1 == K){
          output += S.substring(i , i + 1).toLowerCase();
        }else{
          output += S.substring(i , i + 1);
        } i + 1 == K i + 1 i 1 K {
          output += S.substring(i , i + 1).toLowerCase();
        } output += S.substring(i , i + 1).toLowerCase() output S.substring(i , i + 1).toLowerCase() S.substring(i , i + 1).toLowerCase S.substring(i , i + 1) S.substring S i i + 1 i 1 {
          output += S.substring(i , i + 1);
        } output += S.substring(i , i + 1) output S.substring(i , i + 1) S.substring S i i + 1 i 1 System.out.println(output) System.out.println System.out System System.out output String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      int N = sc.nextInt();
      int K = sc.nextInt();
      String S = sc.next();
      String output = "";
      for(int i = 0; i < N; i++){
        if(i + 1 == K){
          output += S.substring(i , i + 1).toLowerCase();
        }else{
          output += S.substring(i , i + 1);
        }
      }
      System.out.println(output);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      int N = sc.nextInt();
      int K = sc.nextInt();
      String S = sc.next();
      String output = "";
      for(int i = 0; i < N; i++){
        if(i + 1 == K){
          output += S.substring(i , i + 1).toLowerCase();
        }else{
          output += S.substring(i , i + 1);
        }
      }
      System.out.println(output);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//String tmp = sc.next();
		//int tmp = sc.nextInt();
		//Long tmp = sc.nextLong();
      int N = sc.nextInt();
      int K = sc.nextInt();
      String S = sc.next();
      String output = "";
      for(int i = 0; i < N; i++){
        if(i + 1 == K){
          output += S.substring(i , i + 1).toLowerCase();
        }else{
          output += S.substring(i , i + 1);
        }
      }
      System.out.println(output);
	}
}
