import java.util.*;

import java.util.*;
import java.io.*;

class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      char[] s = sc.next().toCharArray();
      
      StringBuilder res = new StringBuilder();
      for(int i = 0;i<s.length;i++){
        if(i+1==k){
          res.append(Character.toLowerCase(s[i]));
        }
        else{
          res.append(s[i]);
        }
      }
      
      System.out.println(res.toString());
      	
    }
} import java.util.*; util.* java import java.util.*; util.* java import java.io.*; io.* java class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      char[] s = sc.next().toCharArray();
      
      StringBuilder res = new StringBuilder();
      for(int i = 0;i<s.length;i++){
        if(i+1==k){
          res.append(Character.toLowerCase(s[i]));
        }
        else{
          res.append(s[i]);
        }
      }
      
      System.out.println(res.toString());
      	
    }
} Main public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      char[] s = sc.next().toCharArray();
      
      StringBuilder res = new StringBuilder();
      for(int i = 0;i<s.length;i++){
        if(i+1==k){
          res.append(Character.toLowerCase(s[i]));
        }
        else{
          res.append(s[i]);
        }
      }
      
      System.out.println(res.toString());
      	
    } main {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      char[] s = sc.next().toCharArray();
      
      StringBuilder res = new StringBuilder();
      for(int i = 0;i<s.length;i++){
        if(i+1==k){
          res.append(Character.toLowerCase(s[i]));
        }
        else{
          res.append(s[i]);
        }
      }
      
      System.out.println(res.toString());
      	
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc StringBuilder res = new StringBuilder(); res new StringBuilder() for(int i = 0;i<s.length;i++){
        if(i+1==k){
          res.append(Character.toLowerCase(s[i]));
        }
        else{
          res.append(s[i]);
        }
      } int i = 0; int i = 0; i 0 i<s.length i s.length s s.length i++ i++ i {
        if(i+1==k){
          res.append(Character.toLowerCase(s[i]));
        }
        else{
          res.append(s[i]);
        }
      } {
        if(i+1==k){
          res.append(Character.toLowerCase(s[i]));
        }
        else{
          res.append(s[i]);
        }
      } if(i+1==k){
          res.append(Character.toLowerCase(s[i]));
        }
        else{
          res.append(s[i]);
        } i+1==k i+1 i 1 k {
          res.append(Character.toLowerCase(s[i]));
        } res.append(Character.toLowerCase(s[i])) res.append res Character.toLowerCase(s[i]) Character.toLowerCase Character s[i] s i {
          res.append(s[i]);
        } res.append(s[i]) res.append res s[i] s i System.out.println(res.toString()) System.out.println System.out System System.out res.toString() res.toString res String[] args args
import java.util.*;

import java.util.*;
import java.io.*;

class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int k = sc.nextInt();
      char[] s = sc.next().toCharArray();
      
      StringBuilder res = new StringBuilder();
      for(int i = 0;i<s.length;i++){
        if(i+1==k){
          res.append(Character.toLowerCase(s[i]));
        }
        else{
          res.append(s[i]);
        }
      }
      
      System.out.println(res.toString());
      	
    }
}