import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Abhijeetkns
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AChangingACharacter solver = new AChangingACharacter();
        solver.solve(1, in, out);
        out.close();
    }

    static class AChangingACharacter {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            String s = in.next();
            s = s.substring(0, k - 1) + s.substring(k - 1, k).toLowerCase() + s.substring(k, s.length());
            out.println(s);
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AChangingACharacter solver = new AChangingACharacter();
        solver.solve(1, in, out);
        out.close();
    }

    static class AChangingACharacter {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            String s = in.next();
            s = s.substring(0, k - 1) + s.substring(k - 1, k).toLowerCase() + s.substring(k, s.length());
            out.println(s);
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AChangingACharacter solver = new AChangingACharacter();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AChangingACharacter solver = new AChangingACharacter();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) AChangingACharacter solver = new AChangingACharacter(); solver new AChangingACharacter() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class AChangingACharacter {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            String s = in.next();
            s = s.substring(0, k - 1) + s.substring(k - 1, k).toLowerCase() + s.substring(k, s.length());
            out.println(s);
        }

    } AChangingACharacter public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            String s = in.next();
            s = s.substring(0, k - 1) + s.substring(k - 1, k).toLowerCase() + s.substring(k, s.length());
            out.println(s);
        } solve {
            int n = in.nextInt();
            int k = in.nextInt();
            String s = in.next();
            s = s.substring(0, k - 1) + s.substring(k - 1, k).toLowerCase() + s.substring(k, s.length());
            out.println(s);
        } int n = in.nextInt(); n in.nextInt() in.nextInt in int k = in.nextInt(); k in.nextInt() in.nextInt in String s = in.next(); s in.next() in.next in s = s.substring(0, k - 1) + s.substring(k - 1, k).toLowerCase() + s.substring(k, s.length()) s s.substring(0, k - 1) + s.substring(k - 1, k).toLowerCase() + s.substring(k, s.length()) s.substring(0, k - 1) + s.substring(k - 1, k).toLowerCase() + s.substring(k, s.length()) s.substring(0, k - 1) s.substring s 0 k - 1 k 1 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 s.substring(k, s.length()) s.substring s k s.length() s.length s out.println(s) out.println out s int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AChangingACharacter solver = new AChangingACharacter();
        solver.solve(1, in, out);
        out.close();
    }

    static class AChangingACharacter {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            String s = in.next();
            s = s.substring(0, k - 1) + s.substring(k - 1, k).toLowerCase() + s.substring(k, s.length());
            out.println(s);
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AChangingACharacter solver = new AChangingACharacter();
        solver.solve(1, in, out);
        out.close();
    }

    static class AChangingACharacter {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            String s = in.next();
            s = s.substring(0, k - 1) + s.substring(k - 1, k).toLowerCase() + s.substring(k, s.length());
            out.println(s);
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Abhijeetkns
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AChangingACharacter solver = new AChangingACharacter();
        solver.solve(1, in, out);
        out.close();
    }

    static class AChangingACharacter {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            String s = in.next();
            s = s.substring(0, k - 1) + s.substring(k - 1, k).toLowerCase() + s.substring(k, s.length());
            out.println(s);
        }

    }
}

