import java.util.Arrays;
import java.util.Scanner;

public class Main {
    MyScanner sc = new MyScanner();
    Scanner sc2 = new Scanner(System.in);
    long start = System.currentTimeMillis();
    long fin = System.currentTimeMillis();
    final int MOD = 1000000007;
    int[] dx = {1, 0, 0, -1};
    int[] dy = {0, 1, -1, 0};

    void run() {
        int N = sc.nextInt();
        int K = sc.nextInt();
        char[] c = sc.next().toCharArray();
        c[K - 1] = Character.toLowerCase(c[K - 1]);
        System.out.println(c);
    }

    public static void main(String[] args) {
        new Main().run();
    }

    void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }


    void debug2(char[][] array) {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]);
            }
            System.out.println();
        }
    }

    boolean inner(int h, int w, int limH, int limW) {
        return 0 <= h && h < limH && 0 <= w && w < limW;
    }

    void swap(int[] x, int a, int b) {
        int tmp = x[a];
        x[a] = x[b];
        x[b] = tmp;
    }

    // find minimum i (k <= a[i])
    int lower_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k <= a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    }

    // find minimum i (k < a[i])
    int upper_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k < a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    }

    long gcd(long a, long b) {
        return a % b == 0 ? b : gcd(b, a % b);
    }

    long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }

    boolean palindrome(String s) {
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            }
        }
        return true;
    }

    class MyScanner {
        int nextInt() {
            try {
                int c = System.in.read();
                while (c != '-' && (c < '0' || '9' < c))
                    c = System.in.read();
                if (c == '-')
                    return -nextInt();
                int res = 0;
                do {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } while ('0' <= c && c <= '9');
                return res;
            } catch (Exception e) {
                return -1;
            }
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String next() {
            try {
                StringBuilder res = new StringBuilder("");
                int c = System.in.read();
                while (Character.isWhitespace(c))
                    c = System.in.read();
                do {
                    res.append((char) c);
                } while (!Character.isWhitespace(c = System.in.read()));
                return res.toString();
            } catch (Exception e) {
                return null;
            }
        }

        int[] nextIntArray(int n) {
            int[] in = new int[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextInt();
            }
            return in;
        }

        int[][] nextInt2dArray(int n, int m) {
            int[][] in = new int[n][m];
            for (int i = 0; i < n; i++) {
                in[i] = nextIntArray(m);
            }
            return in;
        }

        double[] nextDoubleArray(int n) {
            double[] in = new double[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextDouble();
            }
            return in;
        }

        long[] nextLongArray(int n) {
            long[] in = new long[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextLong();
            }
            return in;
        }

        char[][] nextCharField(int n, int m) {
            char[][] in = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                }
            }
            return in;
        }
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    MyScanner sc = new MyScanner();
    Scanner sc2 = new Scanner(System.in);
    long start = System.currentTimeMillis();
    long fin = System.currentTimeMillis();
    final int MOD = 1000000007;
    int[] dx = {1, 0, 0, -1};
    int[] dy = {0, 1, -1, 0};

    void run() {
        int N = sc.nextInt();
        int K = sc.nextInt();
        char[] c = sc.next().toCharArray();
        c[K - 1] = Character.toLowerCase(c[K - 1]);
        System.out.println(c);
    }

    public static void main(String[] args) {
        new Main().run();
    }

    void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }


    void debug2(char[][] array) {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]);
            }
            System.out.println();
        }
    }

    boolean inner(int h, int w, int limH, int limW) {
        return 0 <= h && h < limH && 0 <= w && w < limW;
    }

    void swap(int[] x, int a, int b) {
        int tmp = x[a];
        x[a] = x[b];
        x[b] = tmp;
    }

    // find minimum i (k <= a[i])
    int lower_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k <= a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    }

    // find minimum i (k < a[i])
    int upper_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k < a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    }

    long gcd(long a, long b) {
        return a % b == 0 ? b : gcd(b, a % b);
    }

    long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }

    boolean palindrome(String s) {
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            }
        }
        return true;
    }

    class MyScanner {
        int nextInt() {
            try {
                int c = System.in.read();
                while (c != '-' && (c < '0' || '9' < c))
                    c = System.in.read();
                if (c == '-')
                    return -nextInt();
                int res = 0;
                do {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } while ('0' <= c && c <= '9');
                return res;
            } catch (Exception e) {
                return -1;
            }
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String next() {
            try {
                StringBuilder res = new StringBuilder("");
                int c = System.in.read();
                while (Character.isWhitespace(c))
                    c = System.in.read();
                do {
                    res.append((char) c);
                } while (!Character.isWhitespace(c = System.in.read()));
                return res.toString();
            } catch (Exception e) {
                return null;
            }
        }

        int[] nextIntArray(int n) {
            int[] in = new int[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextInt();
            }
            return in;
        }

        int[][] nextInt2dArray(int n, int m) {
            int[][] in = new int[n][m];
            for (int i = 0; i < n; i++) {
                in[i] = nextIntArray(m);
            }
            return in;
        }

        double[] nextDoubleArray(int n) {
            double[] in = new double[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextDouble();
            }
            return in;
        }

        long[] nextLongArray(int n) {
            long[] in = new long[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextLong();
            }
            return in;
        }

        char[][] nextCharField(int n, int m) {
            char[][] in = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                }
            }
            return in;
        }
    }
} Main MyScanner sc = new MyScanner(); sc new MyScanner() Scanner sc2 = new Scanner(System.in); sc2 new Scanner(System.in) long start = System.currentTimeMillis(); start System.currentTimeMillis() System.currentTimeMillis System long fin = System.currentTimeMillis(); fin System.currentTimeMillis() System.currentTimeMillis System final int MOD = 1000000007; MOD 1000000007 int[] dx = {1, 0, 0, -1}; dx {1, 0, 0, -1} 1 0 0 -1 1 int[] dy = {0, 1, -1, 0}; dy {0, 1, -1, 0} 0 1 -1 1 0 void run() {
        int N = sc.nextInt();
        int K = sc.nextInt();
        char[] c = sc.next().toCharArray();
        c[K - 1] = Character.toLowerCase(c[K - 1]);
        System.out.println(c);
    } run {
        int N = sc.nextInt();
        int K = sc.nextInt();
        char[] c = sc.next().toCharArray();
        c[K - 1] = Character.toLowerCase(c[K - 1]);
        System.out.println(c);
    } int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc char[] c = sc.next().toCharArray(); c sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc c[K - 1] = Character.toLowerCase(c[K - 1]) c[K - 1] c K - 1 K 1 Character.toLowerCase(c[K - 1]) Character.toLowerCase Character c[K - 1] c K - 1 K 1 System.out.println(c) System.out.println System.out System System.out c public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
    } debug {
        System.out.println(Arrays.deepToString(o));
    } System.out.println(Arrays.deepToString(o)) System.out.println System.out System System.out Arrays.deepToString(o) Arrays.deepToString Arrays o Object... o o void debug2(char[][] array) {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]);
            }
            System.out.println();
        }
    } debug2 {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]);
            }
            System.out.println();
        }
    } for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]);
            }
            System.out.println();
        } int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]);
            }
            System.out.println();
        } {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]);
            }
            System.out.println();
        } for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]);
            } int j = 0; int j = 0; j 0 j < array[i].length j array[i].length array[i] array i array[i].length j++ j++ j {
                System.out.print(array[i][j]);
            } {
                System.out.print(array[i][j]);
            } System.out.print(array[i][j]) System.out.print System.out System System.out array[i][j] array[i] array i j System.out.println() System.out.println System.out System System.out char[][] array array boolean inner(int h, int w, int limH, int limW) {
        return 0 <= h && h < limH && 0 <= w && w < limW;
    } inner {
        return 0 <= h && h < limH && 0 <= w && w < limW;
    } return 0 <= h && h < limH && 0 <= w && w < limW; 0 <= h && h < limH && 0 <= w && w < limW 0 <= w 0 <= h && h < limH && 0 <= w && w < limW 0 <= h 0 h h < limH h limH 0 <= w 0 w w < limW w limW int h h int w w int limH limH int limW limW void swap(int[] x, int a, int b) {
        int tmp = x[a];
        x[a] = x[b];
        x[b] = tmp;
    } swap {
        int tmp = x[a];
        x[a] = x[b];
        x[b] = tmp;
    } int tmp = x[a]; tmp x[a] x a x[a] = x[b] x[a] x a x[b] x b x[b] = tmp x[b] x b tmp int[] x x int a a int b b // find minimum i (k <= a[i])
    int lower_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k <= a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    } lower_bound {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k <= a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    } int l = -1; l -1 1 int r = a.length; r a.length a a.length while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k <= a[mid]) r = mid;
            else l = mid;
        } r - l > 1 r - l r l 1 {
            int mid = (l + r) / 2;
            if (k <= a[mid]) r = mid;
            else l = mid;
        } int mid = (l + r) / 2; mid (l + r) / 2 (l + r) l r 2 if (k <= a[mid]) r = mid;
            else l = mid; k <= a[mid] k a[mid] a mid r = mid r mid l = mid l mid return r; r int a[] a int k k // find minimum i (k < a[i])
    int upper_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k < a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    } upper_bound {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k < a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    } int l = -1; l -1 1 int r = a.length; r a.length a a.length while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k < a[mid]) r = mid;
            else l = mid;
        } r - l > 1 r - l r l 1 {
            int mid = (l + r) / 2;
            if (k < a[mid]) r = mid;
            else l = mid;
        } int mid = (l + r) / 2; mid (l + r) / 2 (l + r) l r 2 if (k < a[mid]) r = mid;
            else l = mid; k < a[mid] k a[mid] a mid r = mid r mid l = mid l mid return r; r int a[] a int k k long gcd(long a, long b) {
        return a % b == 0 ? b : gcd(b, a % b);
    } gcd {
        return a % b == 0 ? b : gcd(b, a % b);
    } return a % b == 0 ? b : gcd(b, a % b); a % b == 0 ? b : gcd(b, a % b) a % b == 0 a % b a b 0 b gcd(b, a % b) gcd b a % b a b long a a long b b long lcm(long a, long b) {
        return a * b / gcd(a, b);
    } lcm {
        return a * b / gcd(a, b);
    } return a * b / gcd(a, b); a * b / gcd(a, b) a * b a b gcd(a, b) gcd a b long a a long b b boolean palindrome(String s) {
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            }
        }
        return true;
    } palindrome {
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            }
        }
        return true;
    } for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            }
        } int i = 0; int i = 0; i 0 i < s.length() / 2 i s.length() / 2 s.length() s.length s 2 i++ i++ i {
            if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            }
        } {
            if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            }
        } if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            } s.charAt(i) != s.charAt(s.length() - 1 - i) s.charAt(i) s.charAt s i s.charAt(s.length() - 1 - i) s.charAt s s.length() - 1 - i s.length() - 1 - i s.length() s.length s 1 i {
                return false;
            } return false; false return true; true String s s class MyScanner {
        int nextInt() {
            try {
                int c = System.in.read();
                while (c != '-' && (c < '0' || '9' < c))
                    c = System.in.read();
                if (c == '-')
                    return -nextInt();
                int res = 0;
                do {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } while ('0' <= c && c <= '9');
                return res;
            } catch (Exception e) {
                return -1;
            }
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String next() {
            try {
                StringBuilder res = new StringBuilder("");
                int c = System.in.read();
                while (Character.isWhitespace(c))
                    c = System.in.read();
                do {
                    res.append((char) c);
                } while (!Character.isWhitespace(c = System.in.read()));
                return res.toString();
            } catch (Exception e) {
                return null;
            }
        }

        int[] nextIntArray(int n) {
            int[] in = new int[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextInt();
            }
            return in;
        }

        int[][] nextInt2dArray(int n, int m) {
            int[][] in = new int[n][m];
            for (int i = 0; i < n; i++) {
                in[i] = nextIntArray(m);
            }
            return in;
        }

        double[] nextDoubleArray(int n) {
            double[] in = new double[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextDouble();
            }
            return in;
        }

        long[] nextLongArray(int n) {
            long[] in = new long[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextLong();
            }
            return in;
        }

        char[][] nextCharField(int n, int m) {
            char[][] in = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                }
            }
            return in;
        }
    } MyScanner int nextInt() {
            try {
                int c = System.in.read();
                while (c != '-' && (c < '0' || '9' < c))
                    c = System.in.read();
                if (c == '-')
                    return -nextInt();
                int res = 0;
                do {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } while ('0' <= c && c <= '9');
                return res;
            } catch (Exception e) {
                return -1;
            }
        } nextInt {
            try {
                int c = System.in.read();
                while (c != '-' && (c < '0' || '9' < c))
                    c = System.in.read();
                if (c == '-')
                    return -nextInt();
                int res = 0;
                do {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } while ('0' <= c && c <= '9');
                return res;
            } catch (Exception e) {
                return -1;
            }
        } try {
                int c = System.in.read();
                while (c != '-' && (c < '0' || '9' < c))
                    c = System.in.read();
                if (c == '-')
                    return -nextInt();
                int res = 0;
                do {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } while ('0' <= c && c <= '9');
                return res;
            } catch (Exception e) {
                return -1;
            } catch (Exception e) {
                return -1;
            } Exception e {
                return -1;
            } return -1; -1 1 {
                int c = System.in.read();
                while (c != '-' && (c < '0' || '9' < c))
                    c = System.in.read();
                if (c == '-')
                    return -nextInt();
                int res = 0;
                do {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } while ('0' <= c && c <= '9');
                return res;
            } int c = System.in.read(); c System.in.read() System.in.read System.in System System.in while (c != '-' && (c < '0' || '9' < c))
                    c = System.in.read(); c != '-' && (c < '0' || '9' < c) c != '-' c '-' (c < '0' || '9' < c) c < '0' c '0' '9' < c '9' c c = System.in.read() c System.in.read() System.in.read System.in System System.in if (c == '-')
                    return -nextInt(); c == '-' c '-' return -nextInt(); -nextInt() nextInt() nextInt int res = 0; res 0 do {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } while ('0' <= c && c <= '9'); '0' <= c && c <= '9' '0' <= c '0' c c <= '9' c '9' {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } res *= 10 res 10 res += c - '0' res c - '0' c '0' c = System.in.read() c System.in.read() System.in.read System.in System System.in return res; res double nextDouble() {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next String next() {
            try {
                StringBuilder res = new StringBuilder("");
                int c = System.in.read();
                while (Character.isWhitespace(c))
                    c = System.in.read();
                do {
                    res.append((char) c);
                } while (!Character.isWhitespace(c = System.in.read()));
                return res.toString();
            } catch (Exception e) {
                return null;
            }
        } next {
            try {
                StringBuilder res = new StringBuilder("");
                int c = System.in.read();
                while (Character.isWhitespace(c))
                    c = System.in.read();
                do {
                    res.append((char) c);
                } while (!Character.isWhitespace(c = System.in.read()));
                return res.toString();
            } catch (Exception e) {
                return null;
            }
        } try {
                StringBuilder res = new StringBuilder("");
                int c = System.in.read();
                while (Character.isWhitespace(c))
                    c = System.in.read();
                do {
                    res.append((char) c);
                } while (!Character.isWhitespace(c = System.in.read()));
                return res.toString();
            } catch (Exception e) {
                return null;
            } catch (Exception e) {
                return null;
            } Exception e {
                return null;
            } return null; null {
                StringBuilder res = new StringBuilder("");
                int c = System.in.read();
                while (Character.isWhitespace(c))
                    c = System.in.read();
                do {
                    res.append((char) c);
                } while (!Character.isWhitespace(c = System.in.read()));
                return res.toString();
            } StringBuilder res = new StringBuilder(""); res new StringBuilder("") int c = System.in.read(); c System.in.read() System.in.read System.in System System.in while (Character.isWhitespace(c))
                    c = System.in.read(); Character.isWhitespace(c) Character.isWhitespace Character c c = System.in.read() c System.in.read() System.in.read System.in System System.in do {
                    res.append((char) c);
                } while (!Character.isWhitespace(c = System.in.read())); !Character.isWhitespace(c = System.in.read()) Character.isWhitespace(c = System.in.read()) Character.isWhitespace Character c = System.in.read() c System.in.read() System.in.read System.in System System.in {
                    res.append((char) c);
                } res.append((char) c) res.append res (char) c return res.toString(); res.toString() res.toString res int[] nextIntArray(int n) {
            int[] in = new int[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextInt();
            }
            return in;
        } nextIntArray {
            int[] in = new int[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextInt();
            }
            return in;
        } int[] in = new int[n]; in new int[n] n for (int i = 0; i < n; i++) {
                in[i] = nextInt();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                in[i] = nextInt();
            } {
                in[i] = nextInt();
            } in[i] = nextInt() in[i] in i nextInt() nextInt return in; in int n n int[][] nextInt2dArray(int n, int m) {
            int[][] in = new int[n][m];
            for (int i = 0; i < n; i++) {
                in[i] = nextIntArray(m);
            }
            return in;
        } nextInt2dArray {
            int[][] in = new int[n][m];
            for (int i = 0; i < n; i++) {
                in[i] = nextIntArray(m);
            }
            return in;
        } int[][] in = new int[n][m]; in new int[n][m] n m for (int i = 0; i < n; i++) {
                in[i] = nextIntArray(m);
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                in[i] = nextIntArray(m);
            } {
                in[i] = nextIntArray(m);
            } in[i] = nextIntArray(m) in[i] in i nextIntArray(m) nextIntArray m return in; in int n n int m m double[] nextDoubleArray(int n) {
            double[] in = new double[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextDouble();
            }
            return in;
        } nextDoubleArray {
            double[] in = new double[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextDouble();
            }
            return in;
        } double[] in = new double[n]; in new double[n] n for (int i = 0; i < n; i++) {
                in[i] = nextDouble();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                in[i] = nextDouble();
            } {
                in[i] = nextDouble();
            } in[i] = nextDouble() in[i] in i nextDouble() nextDouble return in; in int n n long[] nextLongArray(int n) {
            long[] in = new long[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextLong();
            }
            return in;
        } nextLongArray {
            long[] in = new long[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextLong();
            }
            return in;
        } long[] in = new long[n]; in new long[n] n for (int i = 0; i < n; i++) {
                in[i] = nextLong();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                in[i] = nextLong();
            } {
                in[i] = nextLong();
            } in[i] = nextLong() in[i] in i nextLong() nextLong return in; in int n n char[][] nextCharField(int n, int m) {
            char[][] in = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                }
            }
            return in;
        } nextCharField {
            char[][] in = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                }
            }
            return in;
        } char[][] in = new char[n][m]; in new char[n][m] n m for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                }
            } {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                }
            } String s = sc.next(); s sc.next() sc.next sc for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                    in[i][j] = s.charAt(j);
                } {
                    in[i][j] = s.charAt(j);
                } in[i][j] = s.charAt(j) in[i][j] in[i] in i j s.charAt(j) s.charAt s j return in; in int n n int m m public class Main {
    MyScanner sc = new MyScanner();
    Scanner sc2 = new Scanner(System.in);
    long start = System.currentTimeMillis();
    long fin = System.currentTimeMillis();
    final int MOD = 1000000007;
    int[] dx = {1, 0, 0, -1};
    int[] dy = {0, 1, -1, 0};

    void run() {
        int N = sc.nextInt();
        int K = sc.nextInt();
        char[] c = sc.next().toCharArray();
        c[K - 1] = Character.toLowerCase(c[K - 1]);
        System.out.println(c);
    }

    public static void main(String[] args) {
        new Main().run();
    }

    void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }


    void debug2(char[][] array) {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]);
            }
            System.out.println();
        }
    }

    boolean inner(int h, int w, int limH, int limW) {
        return 0 <= h && h < limH && 0 <= w && w < limW;
    }

    void swap(int[] x, int a, int b) {
        int tmp = x[a];
        x[a] = x[b];
        x[b] = tmp;
    }

    // find minimum i (k <= a[i])
    int lower_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k <= a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    }

    // find minimum i (k < a[i])
    int upper_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k < a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    }

    long gcd(long a, long b) {
        return a % b == 0 ? b : gcd(b, a % b);
    }

    long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }

    boolean palindrome(String s) {
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            }
        }
        return true;
    }

    class MyScanner {
        int nextInt() {
            try {
                int c = System.in.read();
                while (c != '-' && (c < '0' || '9' < c))
                    c = System.in.read();
                if (c == '-')
                    return -nextInt();
                int res = 0;
                do {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } while ('0' <= c && c <= '9');
                return res;
            } catch (Exception e) {
                return -1;
            }
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String next() {
            try {
                StringBuilder res = new StringBuilder("");
                int c = System.in.read();
                while (Character.isWhitespace(c))
                    c = System.in.read();
                do {
                    res.append((char) c);
                } while (!Character.isWhitespace(c = System.in.read()));
                return res.toString();
            } catch (Exception e) {
                return null;
            }
        }

        int[] nextIntArray(int n) {
            int[] in = new int[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextInt();
            }
            return in;
        }

        int[][] nextInt2dArray(int n, int m) {
            int[][] in = new int[n][m];
            for (int i = 0; i < n; i++) {
                in[i] = nextIntArray(m);
            }
            return in;
        }

        double[] nextDoubleArray(int n) {
            double[] in = new double[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextDouble();
            }
            return in;
        }

        long[] nextLongArray(int n) {
            long[] in = new long[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextLong();
            }
            return in;
        }

        char[][] nextCharField(int n, int m) {
            char[][] in = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                }
            }
            return in;
        }
    }
} public class Main {
    MyScanner sc = new MyScanner();
    Scanner sc2 = new Scanner(System.in);
    long start = System.currentTimeMillis();
    long fin = System.currentTimeMillis();
    final int MOD = 1000000007;
    int[] dx = {1, 0, 0, -1};
    int[] dy = {0, 1, -1, 0};

    void run() {
        int N = sc.nextInt();
        int K = sc.nextInt();
        char[] c = sc.next().toCharArray();
        c[K - 1] = Character.toLowerCase(c[K - 1]);
        System.out.println(c);
    }

    public static void main(String[] args) {
        new Main().run();
    }

    void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }


    void debug2(char[][] array) {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]);
            }
            System.out.println();
        }
    }

    boolean inner(int h, int w, int limH, int limW) {
        return 0 <= h && h < limH && 0 <= w && w < limW;
    }

    void swap(int[] x, int a, int b) {
        int tmp = x[a];
        x[a] = x[b];
        x[b] = tmp;
    }

    // find minimum i (k <= a[i])
    int lower_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k <= a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    }

    // find minimum i (k < a[i])
    int upper_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k < a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    }

    long gcd(long a, long b) {
        return a % b == 0 ? b : gcd(b, a % b);
    }

    long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }

    boolean palindrome(String s) {
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            }
        }
        return true;
    }

    class MyScanner {
        int nextInt() {
            try {
                int c = System.in.read();
                while (c != '-' && (c < '0' || '9' < c))
                    c = System.in.read();
                if (c == '-')
                    return -nextInt();
                int res = 0;
                do {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } while ('0' <= c && c <= '9');
                return res;
            } catch (Exception e) {
                return -1;
            }
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String next() {
            try {
                StringBuilder res = new StringBuilder("");
                int c = System.in.read();
                while (Character.isWhitespace(c))
                    c = System.in.read();
                do {
                    res.append((char) c);
                } while (!Character.isWhitespace(c = System.in.read()));
                return res.toString();
            } catch (Exception e) {
                return null;
            }
        }

        int[] nextIntArray(int n) {
            int[] in = new int[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextInt();
            }
            return in;
        }

        int[][] nextInt2dArray(int n, int m) {
            int[][] in = new int[n][m];
            for (int i = 0; i < n; i++) {
                in[i] = nextIntArray(m);
            }
            return in;
        }

        double[] nextDoubleArray(int n) {
            double[] in = new double[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextDouble();
            }
            return in;
        }

        long[] nextLongArray(int n) {
            long[] in = new long[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextLong();
            }
            return in;
        }

        char[][] nextCharField(int n, int m) {
            char[][] in = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                }
            }
            return in;
        }
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    MyScanner sc = new MyScanner();
    Scanner sc2 = new Scanner(System.in);
    long start = System.currentTimeMillis();
    long fin = System.currentTimeMillis();
    final int MOD = 1000000007;
    int[] dx = {1, 0, 0, -1};
    int[] dy = {0, 1, -1, 0};

    void run() {
        int N = sc.nextInt();
        int K = sc.nextInt();
        char[] c = sc.next().toCharArray();
        c[K - 1] = Character.toLowerCase(c[K - 1]);
        System.out.println(c);
    }

    public static void main(String[] args) {
        new Main().run();
    }

    void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }


    void debug2(char[][] array) {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]);
            }
            System.out.println();
        }
    }

    boolean inner(int h, int w, int limH, int limW) {
        return 0 <= h && h < limH && 0 <= w && w < limW;
    }

    void swap(int[] x, int a, int b) {
        int tmp = x[a];
        x[a] = x[b];
        x[b] = tmp;
    }

    // find minimum i (k <= a[i])
    int lower_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k <= a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    }

    // find minimum i (k < a[i])
    int upper_bound(int a[], int k) {
        int l = -1;
        int r = a.length;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if (k < a[mid]) r = mid;
            else l = mid;
        }
        // r = l + 1
        return r;
    }

    long gcd(long a, long b) {
        return a % b == 0 ? b : gcd(b, a % b);
    }

    long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }

    boolean palindrome(String s) {
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
                return false;
            }
        }
        return true;
    }

    class MyScanner {
        int nextInt() {
            try {
                int c = System.in.read();
                while (c != '-' && (c < '0' || '9' < c))
                    c = System.in.read();
                if (c == '-')
                    return -nextInt();
                int res = 0;
                do {
                    res *= 10;
                    res += c - '0';
                    c = System.in.read();
                } while ('0' <= c && c <= '9');
                return res;
            } catch (Exception e) {
                return -1;
            }
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String next() {
            try {
                StringBuilder res = new StringBuilder("");
                int c = System.in.read();
                while (Character.isWhitespace(c))
                    c = System.in.read();
                do {
                    res.append((char) c);
                } while (!Character.isWhitespace(c = System.in.read()));
                return res.toString();
            } catch (Exception e) {
                return null;
            }
        }

        int[] nextIntArray(int n) {
            int[] in = new int[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextInt();
            }
            return in;
        }

        int[][] nextInt2dArray(int n, int m) {
            int[][] in = new int[n][m];
            for (int i = 0; i < n; i++) {
                in[i] = nextIntArray(m);
            }
            return in;
        }

        double[] nextDoubleArray(int n) {
            double[] in = new double[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextDouble();
            }
            return in;
        }

        long[] nextLongArray(int n) {
            long[] in = new long[n];
            for (int i = 0; i < n; i++) {
                in[i] = nextLong();
            }
            return in;
        }

        char[][] nextCharField(int n, int m) {
            char[][] in = new char[n][m];
            for (int i = 0; i < n; i++) {
                String s = sc.next();
                for (int j = 0; j < m; j++) {
                    in[i][j] = s.charAt(j);
                }
            }
            return in;
        }
    }
}