(let [[s t] (clojure.string/split (read-line) #" ")
      [a b] (map read-string (clojure.string/split (read-line) #" "))
      u (read-line)]
  (cond (= s u) (println (dec a) b)
        (= t u) (println a (dec b))
        :else (println a b)))
