import java.util.*;
import java.lang.Character;

class Main {
  public static void main(String[] args) {
    Map<Integer, String> map = new HashMap<Integer, String>();
    Scanner scanner = new Scanner(System.in);
    int length = scanner.nextInt();
    int target = scanner.nextInt();
    String line = scanner.next();
    for (int i = 0; i < length; i++) {
      if (i == target - 1) {
        System.out.print(Character.toLowerCase(line.charAt(i)));
      }
      else {
        System.out.print(line.charAt(i));
      }
    }
  }
} import java.util.*; util.* java import java.lang.Character; Character java.lang class Main {
  public static void main(String[] args) {
    Map<Integer, String> map = new HashMap<Integer, String>();
    Scanner scanner = new Scanner(System.in);
    int length = scanner.nextInt();
    int target = scanner.nextInt();
    String line = scanner.next();
    for (int i = 0; i < length; i++) {
      if (i == target - 1) {
        System.out.print(Character.toLowerCase(line.charAt(i)));
      }
      else {
        System.out.print(line.charAt(i));
      }
    }
  }
} Main public static void main(String[] args) {
    Map<Integer, String> map = new HashMap<Integer, String>();
    Scanner scanner = new Scanner(System.in);
    int length = scanner.nextInt();
    int target = scanner.nextInt();
    String line = scanner.next();
    for (int i = 0; i < length; i++) {
      if (i == target - 1) {
        System.out.print(Character.toLowerCase(line.charAt(i)));
      }
      else {
        System.out.print(line.charAt(i));
      }
    }
  } main {
    Map<Integer, String> map = new HashMap<Integer, String>();
    Scanner scanner = new Scanner(System.in);
    int length = scanner.nextInt();
    int target = scanner.nextInt();
    String line = scanner.next();
    for (int i = 0; i < length; i++) {
      if (i == target - 1) {
        System.out.print(Character.toLowerCase(line.charAt(i)));
      }
      else {
        System.out.print(line.charAt(i));
      }
    }
  } Map<Integer, String> map = new HashMap<Integer, String>(); map new HashMap<Integer, String>() Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int length = scanner.nextInt(); length scanner.nextInt() scanner.nextInt scanner int target = scanner.nextInt(); target scanner.nextInt() scanner.nextInt scanner String line = scanner.next(); line scanner.next() scanner.next scanner for (int i = 0; i < length; i++) {
      if (i == target - 1) {
        System.out.print(Character.toLowerCase(line.charAt(i)));
      }
      else {
        System.out.print(line.charAt(i));
      }
    } int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
      if (i == target - 1) {
        System.out.print(Character.toLowerCase(line.charAt(i)));
      }
      else {
        System.out.print(line.charAt(i));
      }
    } {
      if (i == target - 1) {
        System.out.print(Character.toLowerCase(line.charAt(i)));
      }
      else {
        System.out.print(line.charAt(i));
      }
    } if (i == target - 1) {
        System.out.print(Character.toLowerCase(line.charAt(i)));
      }
      else {
        System.out.print(line.charAt(i));
      } i == target - 1 i target - 1 target 1 {
        System.out.print(Character.toLowerCase(line.charAt(i)));
      } System.out.print(Character.toLowerCase(line.charAt(i))) System.out.print System.out System System.out Character.toLowerCase(line.charAt(i)) Character.toLowerCase Character line.charAt(i) line.charAt line i {
        System.out.print(line.charAt(i));
      } System.out.print(line.charAt(i)) System.out.print System.out System System.out line.charAt(i) line.charAt line i String[] args args
import java.util.*;
import java.lang.Character;

class Main {
  public static void main(String[] args) {
    Map<Integer, String> map = new HashMap<Integer, String>();
    Scanner scanner = new Scanner(System.in);
    int length = scanner.nextInt();
    int target = scanner.nextInt();
    String line = scanner.next();
    for (int i = 0; i < length; i++) {
      if (i == target - 1) {
        System.out.print(Character.toLowerCase(line.charAt(i)));
      }
      else {
        System.out.print(line.charAt(i));
      }
    }
  }
}