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 C (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <stdio.h>

int main(void){

    int input;
    int a1, a2, a3, a4;
    int flag1 = -1, flag2 = -1;
    scanf("%d", &input);

    a1 = (input % 1000);
    input -= (a1 * 1000);
    a2 = (input % 100);
    input -= (a2 * 100);
    a3 = (input % 10);
    input -= (a3 * 10);
    a4 = input;

    a1 = ((a1 * 10) + a2);
    a3 = ((a3 * 10) + a4);

    if(1 <= a1 && a1 <= 12) flag1 = 1;
    if(1 <= a3 && a3 <= 12) flag2 = 1;

    if((a1==0||a2==0) || (flag1==-1 && flag2==-1)) printf("NA");
    else if(flag1==-1 && flag2==1) printf("YYMM");
    else if(flag1==1 && flag2==-1) printf("MMYY");
    else printf("AMBIGUOUS");

    return 0;
}