import scala.io.StdIn._
object Main extends App {
  val Array(s, t) = readLine.split(" ")
  val Array(a, b) = readLine.split(" ").map(_.toInt)
  readLine match {
    case u if u == s => println(s"${a - 1} $b")
    case _ => println(s"$a ${b - 1}")
  }

}