import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] strs =  br.readLine().split(" ");
    int N = Integer.parseInt(strs[0]);
    int K = Integer.parseInt(strs[1]) - 1;
    String s = br.readLine();
    String[] tmp = new String[N];
    for (int i = 0; i < N; i++) {
      tmp[i] = String.valueOf(s.charAt(i));
    }
    tmp[K] = tmp[K].toLowerCase();
    System.out.println(String.join("", tmp));
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] strs =  br.readLine().split(" ");
    int N = Integer.parseInt(strs[0]);
    int K = Integer.parseInt(strs[1]) - 1;
    String s = br.readLine();
    String[] tmp = new String[N];
    for (int i = 0; i < N; i++) {
      tmp[i] = String.valueOf(s.charAt(i));
    }
    tmp[K] = tmp[K].toLowerCase();
    System.out.println(String.join("", tmp));
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] strs =  br.readLine().split(" ");
    int N = Integer.parseInt(strs[0]);
    int K = Integer.parseInt(strs[1]) - 1;
    String s = br.readLine();
    String[] tmp = new String[N];
    for (int i = 0; i < N; i++) {
      tmp[i] = String.valueOf(s.charAt(i));
    }
    tmp[K] = tmp[K].toLowerCase();
    System.out.println(String.join("", tmp));
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] strs =  br.readLine().split(" ");
    int N = Integer.parseInt(strs[0]);
    int K = Integer.parseInt(strs[1]) - 1;
    String s = br.readLine();
    String[] tmp = new String[N];
    for (int i = 0; i < N; i++) {
      tmp[i] = String.valueOf(s.charAt(i));
    }
    tmp[K] = tmp[K].toLowerCase();
    System.out.println(String.join("", tmp));
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] strs =  br.readLine().split(" "); strs br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int N = Integer.parseInt(strs[0]); N Integer.parseInt(strs[0]) Integer.parseInt Integer strs[0] strs 0 int K = Integer.parseInt(strs[1]) - 1; K Integer.parseInt(strs[1]) - 1 Integer.parseInt(strs[1]) Integer.parseInt Integer strs[1] strs 1 1 String s = br.readLine(); s br.readLine() br.readLine br String[] tmp = new String[N]; tmp new String[N] N for (int i = 0; i < N; i++) {
      tmp[i] = String.valueOf(s.charAt(i));
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      tmp[i] = String.valueOf(s.charAt(i));
    } {
      tmp[i] = String.valueOf(s.charAt(i));
    } tmp[i] = String.valueOf(s.charAt(i)) tmp[i] tmp i String.valueOf(s.charAt(i)) String.valueOf String s.charAt(i) s.charAt s i tmp[K] = tmp[K].toLowerCase() tmp[K] tmp K tmp[K].toLowerCase() tmp[K].toLowerCase tmp[K] tmp K System.out.println(String.join("", tmp)) System.out.println System.out System System.out String.join("", tmp) String.join String "" tmp String[] args args public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] strs =  br.readLine().split(" ");
    int N = Integer.parseInt(strs[0]);
    int K = Integer.parseInt(strs[1]) - 1;
    String s = br.readLine();
    String[] tmp = new String[N];
    for (int i = 0; i < N; i++) {
      tmp[i] = String.valueOf(s.charAt(i));
    }
    tmp[K] = tmp[K].toLowerCase();
    System.out.println(String.join("", tmp));
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] strs =  br.readLine().split(" ");
    int N = Integer.parseInt(strs[0]);
    int K = Integer.parseInt(strs[1]) - 1;
    String s = br.readLine();
    String[] tmp = new String[N];
    for (int i = 0; i < N; i++) {
      tmp[i] = String.valueOf(s.charAt(i));
    }
    tmp[K] = tmp[K].toLowerCase();
    System.out.println(String.join("", tmp));
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] strs =  br.readLine().split(" ");
    int N = Integer.parseInt(strs[0]);
    int K = Integer.parseInt(strs[1]) - 1;
    String s = br.readLine();
    String[] tmp = new String[N];
    for (int i = 0; i < N; i++) {
      tmp[i] = String.valueOf(s.charAt(i));
    }
    tmp[K] = tmp[K].toLowerCase();
    System.out.println(String.join("", tmp));
  }
}