# Remaining Balls
colors  = list(input().split())
numbers = list(map(int, input().split()))
u = input()
numbers[colors.index(u)] -= 1
print(' '.join([str(e) for e in numbers])) colors  = list(input().split()) colors list(input().split()) list input().split() ().split () input split numbers = list(map(int, input().split())) numbers list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split u = input() u input() input numbers[colors.index(u)] -= 1 numbers[colors.index(u)] numbers colors.index(u) colors.index colors index u 1 str(e) for e in numbers for e in numbers e numbers for e in numbers str(e) str e print(' '.join([str(e) for e in numbers])) print ' '.join([str(e) for e in numbers]) ' '.join ' ' join [str(e) for e in numbers] u = input() input() u colors  = list(input().split()) list(input().split()) colors numbers = list(map(int, input().split())) list(map(int, input().split())) numbers
# Remaining Balls
colors  = list(input().split())
numbers = list(map(int, input().split()))
u = input()
numbers[colors.index(u)] -= 1
print(' '.join([str(e) for e in numbers]))