import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String s = sc.next();
    
    StringBuffer buf = new StringBuffer();
    
    for(int i=0; i<n; i++){
      char si = s.charAt(i);
      
      if(i == k-1){
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      }else{
        buf.append(s.charAt(i));
      }
    }
    
    String new_s = buf.toString();
    
    System.out.println(new_s);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String s = sc.next();
    
    StringBuffer buf = new StringBuffer();
    
    for(int i=0; i<n; i++){
      char si = s.charAt(i);
      
      if(i == k-1){
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      }else{
        buf.append(s.charAt(i));
      }
    }
    
    String new_s = buf.toString();
    
    System.out.println(new_s);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String s = sc.next();
    
    StringBuffer buf = new StringBuffer();
    
    for(int i=0; i<n; i++){
      char si = s.charAt(i);
      
      if(i == k-1){
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      }else{
        buf.append(s.charAt(i));
      }
    }
    
    String new_s = buf.toString();
    
    System.out.println(new_s);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String s = sc.next();
    
    StringBuffer buf = new StringBuffer();
    
    for(int i=0; i<n; i++){
      char si = s.charAt(i);
      
      if(i == k-1){
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      }else{
        buf.append(s.charAt(i));
      }
    }
    
    String new_s = buf.toString();
    
    System.out.println(new_s);
  } 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 String s = sc.next(); s sc.next() sc.next sc StringBuffer buf = new StringBuffer(); buf new StringBuffer() for(int i=0; i<n; i++){
      char si = s.charAt(i);
      
      if(i == k-1){
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      }else{
        buf.append(s.charAt(i));
      }
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      char si = s.charAt(i);
      
      if(i == k-1){
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      }else{
        buf.append(s.charAt(i));
      }
    } {
      char si = s.charAt(i);
      
      if(i == k-1){
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      }else{
        buf.append(s.charAt(i));
      }
    } char si = s.charAt(i); si s.charAt(i) s.charAt s i if(i == k-1){
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      }else{
        buf.append(s.charAt(i));
      } i == k-1 i k-1 k 1 {
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      } if(si == 'A'){
        buf.append("a");
        } si == 'A' si 'A' {
        buf.append("a");
        } buf.append("a") buf.append buf "a" if(si == 'B'){
        buf.append("b");
        } si == 'B' si 'B' {
        buf.append("b");
        } buf.append("b") buf.append buf "b" if(si == 'C'){
        buf.append("c");
        } si == 'C' si 'C' {
        buf.append("c");
        } buf.append("c") buf.append buf "c" {
        buf.append(s.charAt(i));
      } buf.append(s.charAt(i)) buf.append buf s.charAt(i) s.charAt s i String new_s = buf.toString(); new_s buf.toString() buf.toString buf System.out.println(new_s) System.out.println System.out System System.out new_s String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String s = sc.next();
    
    StringBuffer buf = new StringBuffer();
    
    for(int i=0; i<n; i++){
      char si = s.charAt(i);
      
      if(i == k-1){
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      }else{
        buf.append(s.charAt(i));
      }
    }
    
    String new_s = buf.toString();
    
    System.out.println(new_s);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String s = sc.next();
    
    StringBuffer buf = new StringBuffer();
    
    for(int i=0; i<n; i++){
      char si = s.charAt(i);
      
      if(i == k-1){
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      }else{
        buf.append(s.charAt(i));
      }
    }
    
    String new_s = buf.toString();
    
    System.out.println(new_s);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String s = sc.next();
    
    StringBuffer buf = new StringBuffer();
    
    for(int i=0; i<n; i++){
      char si = s.charAt(i);
      
      if(i == k-1){
        if(si == 'A'){
        buf.append("a");
        }
        
        if(si == 'B'){
        buf.append("b");
        }
        
        if(si == 'C'){
        buf.append("c");
        }
      }else{
        buf.append(s.charAt(i));
      }
    }
    
    String new_s = buf.toString();
    
    System.out.println(new_s);
  }
}