import java.util.Scanner;

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();
    sc.close();
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < n; i++) {
      if (i == k - 1) sb.append(Character.toLowerCase(s.charAt(i)));
      else sb.append(s.charAt(i));
    }
    System.out.println(sb.toString());
  }
} import java.util.Scanner; Scanner 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();
    sc.close();
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < n; i++) {
      if (i == k - 1) sb.append(Character.toLowerCase(s.charAt(i)));
      else sb.append(s.charAt(i));
    }
    System.out.println(sb.toString());
  }
} 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();
    sc.close();
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < n; i++) {
      if (i == k - 1) sb.append(Character.toLowerCase(s.charAt(i)));
      else sb.append(s.charAt(i));
    }
    System.out.println(sb.toString());
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String s = sc.next();
    sc.close();
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < n; i++) {
      if (i == k - 1) sb.append(Character.toLowerCase(s.charAt(i)));
      else sb.append(s.charAt(i));
    }
    System.out.println(sb.toString());
  } 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 sc.close() sc.close sc StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i = 0; i < n; i++) {
      if (i == k - 1) sb.append(Character.toLowerCase(s.charAt(i)));
      else sb.append(s.charAt(i));
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      if (i == k - 1) sb.append(Character.toLowerCase(s.charAt(i)));
      else sb.append(s.charAt(i));
    } {
      if (i == k - 1) sb.append(Character.toLowerCase(s.charAt(i)));
      else sb.append(s.charAt(i));
    } if (i == k - 1) sb.append(Character.toLowerCase(s.charAt(i)));
      else sb.append(s.charAt(i)); i == k - 1 i k - 1 k 1 sb.append(Character.toLowerCase(s.charAt(i))) sb.append sb Character.toLowerCase(s.charAt(i)) Character.toLowerCase Character s.charAt(i) s.charAt s i sb.append(s.charAt(i)) sb.append sb s.charAt(i) s.charAt s i System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb 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();
    sc.close();
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < n; i++) {
      if (i == k - 1) sb.append(Character.toLowerCase(s.charAt(i)));
      else sb.append(s.charAt(i));
    }
    System.out.println(sb.toString());
  }
} 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();
    sc.close();
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < n; i++) {
      if (i == k - 1) sb.append(Character.toLowerCase(s.charAt(i)));
      else sb.append(s.charAt(i));
    }
    System.out.println(sb.toString());
  }
} Main
import java.util.Scanner;

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();
    sc.close();
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < n; i++) {
      if (i == k - 1) sb.append(Character.toLowerCase(s.charAt(i)));
      else sb.append(s.charAt(i));
    }
    System.out.println(sb.toString());
  }
}
