import scala.math.{min,max}

object Main {
    def main(args: Array[String]) {
        var input = io.Source.stdin.getLines().mkString("\n");
        var ss = input.split('\n').toList;
        val xs = to_array_int(ss(0));
        val n = xs(0);
        val m = xs(1) - 1;
        var s = ss(1).toArray;
        s(m) = s(m).toLower;
        println(s.mkString(""));
    }
    def to_array_int(s: String): Array[Int] = {
        return s.split(' ').map(_.toInt).toArray;
    }
}
