color = input()

kosuu = input()

trashc = input()

_ = 0

color = color.split()
kosuu = kosuu.split()
trashc = trashc.split()


while True:
  if(trashc[0] == color[_]):
    kosuu[_] = int(kosuu[_]) -1
    break
      
  _= _+1
    
print(" ".join(map(str, kosuu))) color = input() color input() input kosuu = input() kosuu input() input trashc = input() trashc input() input _ = 0 _ 0 color = color.split() color color.split() color.split color split kosuu = kosuu.split() kosuu kosuu.split() kosuu.split kosuu split trashc = trashc.split() trashc trashc.split() trashc.split trashc split while True:
  if(trashc[0] == color[_]):
    kosuu[_] = int(kosuu[_]) -1
    break
      
  _= _+1
     True if(trashc[0] == color[_]):
    kosuu[_] = int(kosuu[_]) -1
    break
      
   trashc[0] == color[_] trashc[0] trashc 0 color[_] color _ kosuu[_] = int(kosuu[_]) -1 kosuu[_] kosuu _ int(kosuu[_]) -1 int(kosuu[_]) int kosuu[_] kosuu _ 1 break _= _+1 _ _+1 _ 1 print(" ".join(map(str, kosuu))) print " ".join(map(str, kosuu)) " ".join " " join map(str, kosuu) map str kosuu trashc = input() input() trashc kosuu = input() input() kosuu _= _+1 _+1 _ color = input() input() color _ = 0 0 _ kosuu = kosuu.split() kosuu.split() kosuu trashc = trashc.split() trashc.split() trashc color = color.split() color.split() color
color = input()

kosuu = input()

trashc = input()

_ = 0

color = color.split()
kosuu = kosuu.split()
trashc = trashc.split()


while True:
  if(trashc[0] == color[_]):
    kosuu[_] = int(kosuu[_]) -1
    break
      
  _= _+1
    
print(" ".join(map(str, kosuu)))
