Option Explicit On
Option Strict On

Module Module1

    Sub Main()

        Dim tmp As String() = Split(Console.ReadLine(), " ")
        Dim S As String = tmp(0)
        Dim T As String = tmp(1)
        Dim itmp As String() = Split(Console.ReadLine(), " ")
        Dim A As Integer = CInt(itmp(0))
        Dim B As Integer = CInt(itmp(1))
        Dim U As String = Console.ReadLine()

        If S = U Then
            A -= 1
        End If
        If T = U Then
            B -= 1
        End If

        Console.WriteLine(CStr(A) & " " & CStr(B))

        Console.ReadLine()

    End Sub

End Module
