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

#include <iostream>
#include <string>
#include <algorithm> 
#include <cstdlib>
#include <map>
#include <queue>
#include <climits>
#define ll long long
#define INF 1000000000000000
using namespace std;
ll N;
struct edge{ ll to, cost;};
vector<edge> G[100005];
ll d[100005],d_to[100005],d_back[100005];
typedef pair<ll,ll> P;
ll dijkstra(int s){
    priority_queue<P, vector<P>,greater<P>> que;
    fill(d,d+N,INF);
    d[s] = 0;
    que.push(P(0,s));
 
    while(!que.empty()){
        P p = que.top(); que.pop();
        ll v = p.second;
        if(d[v] < p.first)continue;
 
        for(ll i=0;i<G[v].size();i++){
            edge e = G[v][i];
            if( d[e.to] > d[v] + e.cost){
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to],e.to));
            }
        }
    }
}
int main(){
    cin >> N;

    ll x,y,z;
    for(int i=0;i<N-1;i++){
        cin >> x >> y >> z;
        x--; y--;
        G[x].push_back(edge{y,z});
        G[y].push_back(edge{x,z});
    }
    dijkstra(0);

    for(int i=0;i<N;i++){
        if(d[i]%2==0){
            cout << 0 << endl;
        }else{
            cout << 1 << endl;
        }
    }
}