N_dict  = {i:0 for i in list(map(str,input().split()))}
N_List = list(map(int,input().split()))
ct = 0
for i in N_dict.keys():
    N_dict[i] = N_List[ct]
    ct += 1

N_dict[str(input())] -= 1
print(" ".join(list(map(str,N_dict.values())))) i:0 for i in list(map(str,input().split())) for i in list(map(str,input().split())) i list(map(str,input().split())) list map(str,input().split()) map str input().split() ().split () input split for i in list(map(str,input().split())) i 0 N_dict  = {i:0 for i in list(map(str,input().split()))} N_dict {i:0 for i in list(map(str,input().split()))} N_List = list(map(int,input().split())) N_List list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ct = 0 ct 0 for i in N_dict.keys():
    N_dict[i] = N_List[ct]
    ct += 1 i N_dict.keys() N_dict.keys N_dict keys N_dict[i] = N_List[ct] N_dict[i] N_dict i N_List[ct] N_List ct ct += 1 ct 1 N_dict[str(input())] -= 1 N_dict[str(input())] N_dict str(input()) str input() input 1 print(" ".join(list(map(str,N_dict.values())))) print " ".join(list(map(str,N_dict.values()))) " ".join " " join list(map(str,N_dict.values())) list map(str,N_dict.values()) map str N_dict.values() N_dict.values N_dict values ct += 1 1 ct N_dict  = {i:0 for i in list(map(str,input().split()))} {i:0 for i in list(map(str,input().split()))} N_dict N_List = list(map(int,input().split())) list(map(int,input().split())) N_List ct = 0 0 ct
N_dict  = {i:0 for i in list(map(str,input().split()))}
N_List = list(map(int,input().split()))
ct = 0
for i in N_dict.keys():
    N_dict[i] = N_List[ct]
    ct += 1

N_dict[str(input())] -= 1
print(" ".join(list(map(str,N_dict.values()))))
