Problem:
Score : 100 points

Problem Statement

You are given a string S of length N consisting of A, B and C, and an integer K which is between 1 and N (inclusive).
Print the string S after lowercasing the K-th character in it.

Constraints

1 ≤ N ≤ 50

1 ≤ K ≤ N

S is a string of length N consisting of A, B and C.

Input

Input is given from Standard Input in the following format:

N K
S

Output

Print the string S after lowercasing the K-th character in it.

Sample Input 1

3 1
ABC

Sample Output 1

aBC

Sample Input 2

4 3
CABA

Sample Output 2

CAbA

Solution in Rust (1.15.1) (judge verdict: Accepted)

// #[warn(dead_code)]
// const TOP: u64 = 1000000007;

fn main() {
	let text = {
		use std::io::Read;
		let mut s = String::new();
		std::io::stdin().read_to_string(&mut s).unwrap();
		s
	};

	let mut iter = text.split_whitespace();
	let _: usize = iter.next().unwrap().parse().unwrap();
	let index: usize = iter.next().unwrap().parse().unwrap();
	let index = index - 1;
	let word: String = iter.next().unwrap().parse().unwrap();

	let word: String = word
		.chars()
		.enumerate()
		.map(|(i, c)| {
			if i == index {
				match c {
					'A' => 'a',
					'B' => 'b',
					'C' => 'c',
					_ => ' ',
				}
			} else {
				c
			}
		})
		.fold("".to_string(), |s, c| format!("{}{}", s, c));

	println!("{}", word);
}