import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    [s,t] <- words <$> getLine
    [a, b] <- getIntList
    u <- getLine
    putStrLn . unwords . map show $ solve s t a b u

solve s t a b u | s == u = [a - 1, b]
                | t == u = [a, b - 1]