
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
            // main
        Scanner sc = new Scanner(System.in);
        int N = nextInt(sc);
        int K = nextInt(sc);
        String S = getLine(sc);

        show(calc(N, K, S));

    }

    private static String calc(int N, int K, String S) {
        StringBuilder str;
        str = new StringBuilder();

        char[] charArray = S.toCharArray();
        for (int i = 0; i < N; i++) {
            char c = charArray[i];

            if (i + 1 == K) c = toLower(c);

            str.append(c);

        }
        return str.toString();
    }

    private static String getLine(Scanner sc) { return sc.next(); }
    private static int nextInt(Scanner sc) { return Integer.parseInt(sc.next()); }
    private static void show(String answer) {
        System.out.println(answer);
    }
    private static char toLower(char c) { return (char)(c + 32); }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
            // main
        Scanner sc = new Scanner(System.in);
        int N = nextInt(sc);
        int K = nextInt(sc);
        String S = getLine(sc);

        show(calc(N, K, S));

    }

    private static String calc(int N, int K, String S) {
        StringBuilder str;
        str = new StringBuilder();

        char[] charArray = S.toCharArray();
        for (int i = 0; i < N; i++) {
            char c = charArray[i];

            if (i + 1 == K) c = toLower(c);

            str.append(c);

        }
        return str.toString();
    }

    private static String getLine(Scanner sc) { return sc.next(); }
    private static int nextInt(Scanner sc) { return Integer.parseInt(sc.next()); }
    private static void show(String answer) {
        System.out.println(answer);
    }
    private static char toLower(char c) { return (char)(c + 32); }
} Main public static void main(String[] args) {
            // main
        Scanner sc = new Scanner(System.in);
        int N = nextInt(sc);
        int K = nextInt(sc);
        String S = getLine(sc);

        show(calc(N, K, S));

    } main {
            // main
        Scanner sc = new Scanner(System.in);
        int N = nextInt(sc);
        int K = nextInt(sc);
        String S = getLine(sc);

        show(calc(N, K, S));

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = nextInt(sc); N nextInt(sc) nextInt sc int K = nextInt(sc); K nextInt(sc) nextInt sc String S = getLine(sc); S getLine(sc) getLine sc show(calc(N, K, S)) show calc(N, K, S) calc N K S String[] args args private static String calc(int N, int K, String S) {
        StringBuilder str;
        str = new StringBuilder();

        char[] charArray = S.toCharArray();
        for (int i = 0; i < N; i++) {
            char c = charArray[i];

            if (i + 1 == K) c = toLower(c);

            str.append(c);

        }
        return str.toString();
    } calc {
        StringBuilder str;
        str = new StringBuilder();

        char[] charArray = S.toCharArray();
        for (int i = 0; i < N; i++) {
            char c = charArray[i];

            if (i + 1 == K) c = toLower(c);

            str.append(c);

        }
        return str.toString();
    } StringBuilder str; str str = new StringBuilder() str new StringBuilder() char[] charArray = S.toCharArray(); charArray S.toCharArray() S.toCharArray S for (int i = 0; i < N; i++) {
            char c = charArray[i];

            if (i + 1 == K) c = toLower(c);

            str.append(c);

        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            char c = charArray[i];

            if (i + 1 == K) c = toLower(c);

            str.append(c);

        } {
            char c = charArray[i];

            if (i + 1 == K) c = toLower(c);

            str.append(c);

        } char c = charArray[i]; c charArray[i] charArray i if (i + 1 == K) c = toLower(c); i + 1 == K i + 1 i 1 K c = toLower(c) c toLower(c) toLower c str.append(c) str.append str c return str.toString(); str.toString() str.toString str int N N int K K String S S private static String getLine(Scanner sc) { return sc.next(); } getLine { return sc.next(); } return sc.next(); sc.next() sc.next sc Scanner sc sc private static int nextInt(Scanner sc) { return Integer.parseInt(sc.next()); } nextInt { return Integer.parseInt(sc.next()); } return Integer.parseInt(sc.next()); Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Scanner sc sc private static void show(String answer) {
        System.out.println(answer);
    } show {
        System.out.println(answer);
    } System.out.println(answer) System.out.println System.out System System.out answer String answer answer private static char toLower(char c) { return (char)(c + 32); } toLower { return (char)(c + 32); } return (char)(c + 32); (char)(c + 32) c 32 char c c public class Main {
    public static void main(String[] args) {
            // main
        Scanner sc = new Scanner(System.in);
        int N = nextInt(sc);
        int K = nextInt(sc);
        String S = getLine(sc);

        show(calc(N, K, S));

    }

    private static String calc(int N, int K, String S) {
        StringBuilder str;
        str = new StringBuilder();

        char[] charArray = S.toCharArray();
        for (int i = 0; i < N; i++) {
            char c = charArray[i];

            if (i + 1 == K) c = toLower(c);

            str.append(c);

        }
        return str.toString();
    }

    private static String getLine(Scanner sc) { return sc.next(); }
    private static int nextInt(Scanner sc) { return Integer.parseInt(sc.next()); }
    private static void show(String answer) {
        System.out.println(answer);
    }
    private static char toLower(char c) { return (char)(c + 32); }
} public class Main {
    public static void main(String[] args) {
            // main
        Scanner sc = new Scanner(System.in);
        int N = nextInt(sc);
        int K = nextInt(sc);
        String S = getLine(sc);

        show(calc(N, K, S));

    }

    private static String calc(int N, int K, String S) {
        StringBuilder str;
        str = new StringBuilder();

        char[] charArray = S.toCharArray();
        for (int i = 0; i < N; i++) {
            char c = charArray[i];

            if (i + 1 == K) c = toLower(c);

            str.append(c);

        }
        return str.toString();
    }

    private static String getLine(Scanner sc) { return sc.next(); }
    private static int nextInt(Scanner sc) { return Integer.parseInt(sc.next()); }
    private static void show(String answer) {
        System.out.println(answer);
    }
    private static char toLower(char c) { return (char)(c + 32); }
} Main

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
            // main
        Scanner sc = new Scanner(System.in);
        int N = nextInt(sc);
        int K = nextInt(sc);
        String S = getLine(sc);

        show(calc(N, K, S));

    }

    private static String calc(int N, int K, String S) {
        StringBuilder str;
        str = new StringBuilder();

        char[] charArray = S.toCharArray();
        for (int i = 0; i < N; i++) {
            char c = charArray[i];

            if (i + 1 == K) c = toLower(c);

            str.append(c);

        }
        return str.toString();
    }

    private static String getLine(Scanner sc) { return sc.next(); }
    private static int nextInt(Scanner sc) { return Integer.parseInt(sc.next()); }
    private static void show(String answer) {
        System.out.println(answer);
    }
    private static char toLower(char c) { return (char)(c + 32); }
}