ri = lambda S: [int(v) for v in S.split()]
def rii(): return ri(input())

S, T = input().split()
A, B = rii()
U = input()
D = {S:A, T:B}
D[U] -= 1

print(D[S], D[T]) int(v) for v in S.split() for v in S.split() v S.split() S.split S split for v in S.split() int(v) int v ri = lambda S: [int(v) for v in S.split()] ri lambda S: [int(v) for v in S.split()] [int(v) for v in S.split()] S def rii(): return ri(input()) rii S, T = input().split() S input().split() ().split () input split T A, B = rii() A rii() rii B U = input() U input() input D = {S:A, T:B} D {S:A, T:B} S S A T T B D[U] -= 1 D[U] D U 1 print(D[S], D[T]) print D[S] D S D[T] D T B = rii() rii() B D = {S:A, T:B} {S:A, T:B} D def rii(): return ri(input()) def rii(): return ri(input()) rii S, T = input().split() input().split() S T = input().split() input().split() T A, B = rii() rii() A U = input() input() U ri = lambda S: [int(v) for v in S.split()] lambda S: [int(v) for v in S.split()] ri
ri = lambda S: [int(v) for v in S.split()]
def rii(): return ri(input())

S, T = input().split()
A, B = rii()
U = input()
D = {S:A, T:B}
D[U] -= 1

print(D[S], D[T])