color=input().split()
number = list(map(int, input().split()))
c = input()
for i in range(2):
  if c == color[i]: number[i] -= 1
number = list(map(str, number))
print(' '.join(number)) color=input().split() color input().split() ().split () input split number = list(map(int, input().split())) number list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split c = input() c input() input for i in range(2):
  if c == color[i]: number[i] -= 1 i range(2) range 2 if c == color[i]: number[i] -= c == color[i] c color[i] color i number = list(map(str, number)) number list(map(str, number)) list map(str, number) map str number print(' '.join(number)) print ' '.join(number) ' '.join ' ' join number color=input().split() input().split() color c = input() input() c number = list(map(str, number)) list(map(str, number)) number number = list(map(int, input().split())) list(map(int, input().split())) number
color=input().split()
number = list(map(int, input().split()))
c = input()
for i in range(2):
  if c == color[i]: number[i] -= 1
number = list(map(str, number))
print(' '.join(number))