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 Scala (2.11.7) (judge verdict: Accepted)

object Main {
  import java.util.Scanner

  implicit class RichScanner(sc: Scanner) {
    def readStrings(n: Int): Array[String] = Array.fill(n) { sc.next() }
    def readInts(n: Int): Array[Int] = Array.fill(n) { sc.nextInt() }
    def readLongs(n: Int): Array[Long] = Array.fill(n) { sc.nextLong() }
    def readLineStrings: Array[String] = sc.nextLine().split(' ')
    def readLineInts: Array[Int] = readLineStrings.map(_.toInt)
    def readLineLongs: Array[Long] = readLineStrings.map(_.toLong)
  }

  def main(args: Array[String]): Unit = solve(new Scanner(System.in))

  def solve(sc: Scanner): Unit = {
    val Array(n, k) = sc.readLineInts
    val S = sc.nextLine()
    println(S.take(k - 1) + S.charAt(k - 1).toLower + S.slice(k, n))
  }
}