import java.util.*;
public class Main {
    public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
	    int n = s.nextInt(), m = s.nextInt() - 1;
	    char[] cs = s.next().toCharArray();
	    //A - a = -32
	    cs[m] += ('a' - 'A');
	    System.out.println(cs);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
	    int n = s.nextInt(), m = s.nextInt() - 1;
	    char[] cs = s.next().toCharArray();
	    //A - a = -32
	    cs[m] += ('a' - 'A');
	    System.out.println(cs);
    }
} Main public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
	    int n = s.nextInt(), m = s.nextInt() - 1;
	    char[] cs = s.next().toCharArray();
	    //A - a = -32
	    cs[m] += ('a' - 'A');
	    System.out.println(cs);
    } main {
	    Scanner s = new Scanner(System.in);
	    int n = s.nextInt(), m = s.nextInt() - 1;
	    char[] cs = s.next().toCharArray();
	    //A - a = -32
	    cs[m] += ('a' - 'A');
	    System.out.println(cs);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt() n s.nextInt() s.nextInt s m = s.nextInt() - 1; m s.nextInt() - 1 s.nextInt() s.nextInt s 1 char[] cs = s.next().toCharArray(); cs s.next().toCharArray() s.next().toCharArray s.next() s.next s cs[m] += ('a' - 'A') cs[m] cs m ('a' - 'A') 'a' 'A' System.out.println(cs) System.out.println System.out System System.out cs String[] args args public class Main {
    public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
	    int n = s.nextInt(), m = s.nextInt() - 1;
	    char[] cs = s.next().toCharArray();
	    //A - a = -32
	    cs[m] += ('a' - 'A');
	    System.out.println(cs);
    }
} public class Main {
    public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
	    int n = s.nextInt(), m = s.nextInt() - 1;
	    char[] cs = s.next().toCharArray();
	    //A - a = -32
	    cs[m] += ('a' - 'A');
	    System.out.println(cs);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
	    Scanner s = new Scanner(System.in);
	    int n = s.nextInt(), m = s.nextInt() - 1;
	    char[] cs = s.next().toCharArray();
	    //A - a = -32
	    cs[m] += ('a' - 'A');
	    System.out.println(cs);
    }
}