import java.util.*;

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


    int n = sc.nextInt();
    String[] mozi = new String [n];

    int k = sc.nextInt();
    String i = mozi[k - 1];


    String s = sc.next();

    String ans = "";
    for (int y = 0; y < n; y++) {
      if (y == k - 1) {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      }
      else {
        ans += String.valueOf(s.charAt(y));
      }
    }

    System.out.println(ans);


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


    int n = sc.nextInt();
    String[] mozi = new String [n];

    int k = sc.nextInt();
    String i = mozi[k - 1];


    String s = sc.next();

    String ans = "";
    for (int y = 0; y < n; y++) {
      if (y == k - 1) {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      }
      else {
        ans += String.valueOf(s.charAt(y));
      }
    }

    System.out.println(ans);


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


    int n = sc.nextInt();
    String[] mozi = new String [n];

    int k = sc.nextInt();
    String i = mozi[k - 1];


    String s = sc.next();

    String ans = "";
    for (int y = 0; y < n; y++) {
      if (y == k - 1) {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      }
      else {
        ans += String.valueOf(s.charAt(y));
      }
    }

    System.out.println(ans);


	} main {
    Scanner sc = new Scanner(System.in);


    int n = sc.nextInt();
    String[] mozi = new String [n];

    int k = sc.nextInt();
    String i = mozi[k - 1];


    String s = sc.next();

    String ans = "";
    for (int y = 0; y < n; y++) {
      if (y == k - 1) {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      }
      else {
        ans += String.valueOf(s.charAt(y));
      }
    }

    System.out.println(ans);


	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] mozi = new String [n]; mozi new String [n] n int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc String i = mozi[k - 1]; i mozi[k - 1] mozi k - 1 k 1 String s = sc.next(); s sc.next() sc.next sc String ans = ""; ans "" for (int y = 0; y < n; y++) {
      if (y == k - 1) {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      }
      else {
        ans += String.valueOf(s.charAt(y));
      }
    } int y = 0; int y = 0; y 0 y < n y n y++ y++ y {
      if (y == k - 1) {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      }
      else {
        ans += String.valueOf(s.charAt(y));
      }
    } {
      if (y == k - 1) {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      }
      else {
        ans += String.valueOf(s.charAt(y));
      }
    } if (y == k - 1) {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      }
      else {
        ans += String.valueOf(s.charAt(y));
      } y == k - 1 y k - 1 k 1 {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      } ans += String.valueOf(s.charAt(y)).toLowerCase() ans String.valueOf(s.charAt(y)).toLowerCase() String.valueOf(s.charAt(y)).toLowerCase String.valueOf(s.charAt(y)) String.valueOf String s.charAt(y) s.charAt s y {
        ans += String.valueOf(s.charAt(y));
      } ans += String.valueOf(s.charAt(y)) ans String.valueOf(s.charAt(y)) String.valueOf String s.charAt(y) s.charAt s y System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);


    int n = sc.nextInt();
    String[] mozi = new String [n];

    int k = sc.nextInt();
    String i = mozi[k - 1];


    String s = sc.next();

    String ans = "";
    for (int y = 0; y < n; y++) {
      if (y == k - 1) {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      }
      else {
        ans += String.valueOf(s.charAt(y));
      }
    }

    System.out.println(ans);


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


    int n = sc.nextInt();
    String[] mozi = new String [n];

    int k = sc.nextInt();
    String i = mozi[k - 1];


    String s = sc.next();

    String ans = "";
    for (int y = 0; y < n; y++) {
      if (y == k - 1) {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      }
      else {
        ans += String.valueOf(s.charAt(y));
      }
    }

    System.out.println(ans);


	}
} Main
import java.util.*;

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


    int n = sc.nextInt();
    String[] mozi = new String [n];

    int k = sc.nextInt();
    String i = mozi[k - 1];


    String s = sc.next();

    String ans = "";
    for (int y = 0; y < n; y++) {
      if (y == k - 1) {
        ans += String.valueOf(s.charAt(y)).toLowerCase();
      }
      else {
        ans += String.valueOf(s.charAt(y));
      }
    }

    System.out.println(ans);


	}
}
