keys = input().split(' ')
vals = list(map(int, input().split(' ')))
hoge = input()
print(vals[0]-(keys[0]==hoge), vals[1]-(keys[1]==hoge)) keys = input().split(' ') keys input().split(' ') ().split () input split ' ' vals = list(map(int, input().split(' '))) vals list(map(int, input().split(' '))) list map(int, input().split(' ')) map int input().split(' ') ().split () input split ' ' hoge = input() hoge input() input print(vals[0]-(keys[0]==hoge), vals[1]-(keys[1]==hoge)) print vals[0]-(keys[0]==hoge) vals[0] vals 0 keys[0]==hoge keys[0] keys 0 hoge vals[1]-(keys[1]==hoge) vals[1] vals 1 keys[1]==hoge keys[1] keys 1 hoge keys = input().split(' ') input().split(' ') keys hoge = input() input() hoge vals = list(map(int, input().split(' '))) list(map(int, input().split(' '))) vals
keys = input().split(' ')
vals = list(map(int, input().split(' ')))
hoge = input()
print(vals[0]-(keys[0]==hoge), vals[1]-(keys[1]==hoge))