fun main(arr:Array<String>) {
    val moji = readLine()!!.split(" ")
    val count = readLine()!!.split(" ").map { it.toLong() }.toMutableList()
    val word = readLine()!!
    val idx = moji.indexOf(word)
    count[idx] -= 1L
    println(count.joinToString(" "))
}