func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let nk = readInts()
    // let n = nk[0]
    let k = nk[1]
    var s = Array(readLine()!)
    
    if s[k - 1] == "A" {
        s[k - 1] = "a"
    } else if s[k - 1] == "B" {
        s[k - 1] = "b"
    } else {
        s[k - 1] = "c"
    }
    
    print(s.reduce("") { $0 + String($1) })
}

main()
