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 line = sc.nextLine();
    line = sc.nextLine();
    String[] spl = line.split("");
    spl[k-1] = spl[k-1].toLowerCase();
//    System.out.println(spl[k-1]);
    line = "";
    for(int i = 0; i < n; i++){
//      System.out.println(spl[i]);
      line += spl[i];
    }
    System.out.println(line);
  }
} 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 line = sc.nextLine();
    line = sc.nextLine();
    String[] spl = line.split("");
    spl[k-1] = spl[k-1].toLowerCase();
//    System.out.println(spl[k-1]);
    line = "";
    for(int i = 0; i < n; i++){
//      System.out.println(spl[i]);
      line += spl[i];
    }
    System.out.println(line);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String line = sc.nextLine();
    line = sc.nextLine();
    String[] spl = line.split("");
    spl[k-1] = spl[k-1].toLowerCase();
//    System.out.println(spl[k-1]);
    line = "";
    for(int i = 0; i < n; i++){
//      System.out.println(spl[i]);
      line += spl[i];
    }
    System.out.println(line);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String line = sc.nextLine();
    line = sc.nextLine();
    String[] spl = line.split("");
    spl[k-1] = spl[k-1].toLowerCase();
//    System.out.println(spl[k-1]);
    line = "";
    for(int i = 0; i < n; i++){
//      System.out.println(spl[i]);
      line += spl[i];
    }
    System.out.println(line);
  } 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 line = sc.nextLine(); line sc.nextLine() sc.nextLine sc line = sc.nextLine() line sc.nextLine() sc.nextLine sc String[] spl = line.split(""); spl line.split("") line.split line "" spl[k-1] = spl[k-1].toLowerCase() spl[k-1] spl k-1 k 1 spl[k-1].toLowerCase() spl[k-1].toLowerCase spl[k-1] spl k-1 k 1 line = "" line "" for(int i = 0; i < n; i++){
//      System.out.println(spl[i]);
      line += spl[i];
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
//      System.out.println(spl[i]);
      line += spl[i];
    } {
//      System.out.println(spl[i]);
      line += spl[i];
    } line += spl[i] line spl[i] spl i System.out.println(line) System.out.println System.out System System.out line 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 line = sc.nextLine();
    line = sc.nextLine();
    String[] spl = line.split("");
    spl[k-1] = spl[k-1].toLowerCase();
//    System.out.println(spl[k-1]);
    line = "";
    for(int i = 0; i < n; i++){
//      System.out.println(spl[i]);
      line += spl[i];
    }
    System.out.println(line);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String line = sc.nextLine();
    line = sc.nextLine();
    String[] spl = line.split("");
    spl[k-1] = spl[k-1].toLowerCase();
//    System.out.println(spl[k-1]);
    line = "";
    for(int i = 0; i < n; i++){
//      System.out.println(spl[i]);
      line += spl[i];
    }
    System.out.println(line);
  }
} 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 line = sc.nextLine();
    line = sc.nextLine();
    String[] spl = line.split("");
    spl[k-1] = spl[k-1].toLowerCase();
//    System.out.println(spl[k-1]);
    line = "";
    for(int i = 0; i < n; i++){
//      System.out.println(spl[i]);
      line += spl[i];
    }
    System.out.println(line);
  }
}