object Main {
  import scala.io.StdIn._
  def main(args: Array[String]): Unit = {
    val Array(s,t) = readLine().split(" ")
    val Array(a,b) = readLine().split(" ").map(_.toInt)
    readLine match {
      case x if x == s => println(s"${a - 1} ${b}")
      case x => println(s"${a} ${b-1}")
    }
  }
}