import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int K = in.nextInt() - 1;
      char[] S = in.next().toCharArray();

      S[K] = Character.toLowerCase(S[K]);

      System.out.println(S);
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int K = in.nextInt() - 1;
      char[] S = in.next().toCharArray();

      S[K] = Character.toLowerCase(S[K]);

      System.out.println(S);
    }
  }
} Main public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int K = in.nextInt() - 1;
      char[] S = in.next().toCharArray();

      S[K] = Character.toLowerCase(S[K]);

      System.out.println(S);
    }
  } main {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int K = in.nextInt() - 1;
      char[] S = in.next().toCharArray();

      S[K] = Character.toLowerCase(S[K]);

      System.out.println(S);
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) while (in.hasNext()) {
      int N = in.nextInt();
      int K = in.nextInt() - 1;
      char[] S = in.next().toCharArray();

      S[K] = Character.toLowerCase(S[K]);

      System.out.println(S);
    } in.hasNext() in.hasNext in {
      int N = in.nextInt();
      int K = in.nextInt() - 1;
      char[] S = in.next().toCharArray();

      S[K] = Character.toLowerCase(S[K]);

      System.out.println(S);
    } int N = in.nextInt(); N in.nextInt() in.nextInt in int K = in.nextInt() - 1; K in.nextInt() - 1 in.nextInt() in.nextInt in 1 char[] S = in.next().toCharArray(); S in.next().toCharArray() in.next().toCharArray in.next() in.next in S[K] = Character.toLowerCase(S[K]) S[K] S K Character.toLowerCase(S[K]) Character.toLowerCase Character S[K] S K System.out.println(S) System.out.println System.out System System.out S String[] args args public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int K = in.nextInt() - 1;
      char[] S = in.next().toCharArray();

      S[K] = Character.toLowerCase(S[K]);

      System.out.println(S);
    }
  }
} public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int K = in.nextInt() - 1;
      char[] S = in.next().toCharArray();

      S[K] = Character.toLowerCase(S[K]);

      System.out.println(S);
    }
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      int K = in.nextInt() - 1;
      char[] S = in.next().toCharArray();

      S[K] = Character.toLowerCase(S[K]);

      System.out.println(S);
    }
  }
}