# h, a = map(int, input().split())
from collections import OrderedDict
d = OrderedDict()
a = list(input().split())
b = list(map(int, input().split()))
for i in range(2):
	d[a[i]] = b[i]
d[input()] -= 1
print(*d.values()) from collections import OrderedDict d = OrderedDict() d OrderedDict() OrderedDict a = list(input().split()) a list(input().split()) list input().split() ().split () input split b = list(map(int, input().split())) b list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for i in range(2):
	d[a[i]] = b[i] i range(2) range 2 d[a[i]] = b[i] d[a[i]] d a[i] a i b[i] b i d[input()] -= 1 d[input()] d input() input 1 print(*d.values()) print *d.values() d.values() d.values d values a = list(input().split()) list(input().split()) a b = list(map(int, input().split())) list(map(int, input().split())) b d = OrderedDict() OrderedDict() d
# h, a = map(int, input().split())
from collections import OrderedDict
d = OrderedDict()
a = list(input().split())
b = list(map(int, input().split()))
for i in range(2):
	d[a[i]] = b[i]
d[input()] -= 1
print(*d.values())