import java.util.*;
class Main {
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int k = stdIn.nextInt();
    String s = stdIn.next();
    String s1 = s.substring(0,k-1);
    String s2 = s.substring(k-1,k).toLowerCase();
    String s3 = s.substring(k,n);
    String s4 = s1+s2+s3;
    System.out.println(s4);
  }

} import java.util.*; util.* java class Main {
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int k = stdIn.nextInt();
    String s = stdIn.next();
    String s1 = s.substring(0,k-1);
    String s2 = s.substring(k-1,k).toLowerCase();
    String s3 = s.substring(k,n);
    String s4 = s1+s2+s3;
    System.out.println(s4);
  }

} Main public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int k = stdIn.nextInt();
    String s = stdIn.next();
    String s1 = s.substring(0,k-1);
    String s2 = s.substring(k-1,k).toLowerCase();
    String s3 = s.substring(k,n);
    String s4 = s1+s2+s3;
    System.out.println(s4);
  } main {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int k = stdIn.nextInt();
    String s = stdIn.next();
    String s1 = s.substring(0,k-1);
    String s2 = s.substring(k-1,k).toLowerCase();
    String s3 = s.substring(k,n);
    String s4 = s1+s2+s3;
    System.out.println(s4);
  } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int k = stdIn.nextInt(); k stdIn.nextInt() stdIn.nextInt stdIn String s = stdIn.next(); s stdIn.next() stdIn.next stdIn String s1 = s.substring(0,k-1); s1 s.substring(0,k-1) s.substring s 0 k-1 k 1 String s2 = s.substring(k-1,k).toLowerCase(); s2 s.substring(k-1,k).toLowerCase() s.substring(k-1,k).toLowerCase s.substring(k-1,k) s.substring s k-1 k 1 k String s3 = s.substring(k,n); s3 s.substring(k,n) s.substring s k n String s4 = s1+s2+s3; s4 s1+s2+s3 s1+s2+s3 s1 s2 s3 System.out.println(s4) System.out.println System.out System System.out s4 String[] args args
import java.util.*;
class Main {
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int k = stdIn.nextInt();
    String s = stdIn.next();
    String s1 = s.substring(0,k-1);
    String s2 = s.substring(k-1,k).toLowerCase();
    String s3 = s.substring(k,n);
    String s4 = s1+s2+s3;
    System.out.println(s4);
  }

}