import java.util.Scanner;
class Main {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        char ar[]= new char[n];
        int k=in.nextInt();
        ar=in.next().toCharArray();
        char ch=Character.toLowerCase(ar[k-1]);
        ar[k-1]=ch;
        for(char x:ar)
        {
            System.out.print(x);
        }    
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        char ar[]= new char[n];
        int k=in.nextInt();
        ar=in.next().toCharArray();
        char ch=Character.toLowerCase(ar[k-1]);
        ar[k-1]=ch;
        for(char x:ar)
        {
            System.out.print(x);
        }    
    }
} Main public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        char ar[]= new char[n];
        int k=in.nextInt();
        ar=in.next().toCharArray();
        char ch=Character.toLowerCase(ar[k-1]);
        ar[k-1]=ch;
        for(char x:ar)
        {
            System.out.print(x);
        }    
    } main {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        char ar[]= new char[n];
        int k=in.nextInt();
        ar=in.next().toCharArray();
        char ch=Character.toLowerCase(ar[k-1]);
        ar[k-1]=ch;
        for(char x:ar)
        {
            System.out.print(x);
        }    
    } Scanner in=new Scanner(System.in); in new Scanner(System.in) int n=in.nextInt(); n in.nextInt() in.nextInt in char ar[]= new char[n]; ar new char[n] n int k=in.nextInt(); k in.nextInt() in.nextInt in ar=in.next().toCharArray() ar in.next().toCharArray() in.next().toCharArray in.next() in.next in char ch=Character.toLowerCase(ar[k-1]); ch Character.toLowerCase(ar[k-1]) Character.toLowerCase Character ar[k-1] ar k-1 k 1 ar[k-1]=ch ar[k-1] ar k-1 k 1 ch for(char x:ar)
        {
            System.out.print(x);
        } char x ar {
            System.out.print(x);
        } {
            System.out.print(x);
        } System.out.print(x) System.out.print System.out System System.out x String[] args args
import java.util.Scanner;
class Main {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        char ar[]= new char[n];
        int k=in.nextInt();
        ar=in.next().toCharArray();
        char ch=Character.toLowerCase(ar[k-1]);
        ar[k-1]=ch;
        for(char x:ar)
        {
            System.out.print(x);
        }    
    }
}
