
if __name__ == '__main__':

	tmp0 = input().split()
	tmp1 = map(int,input().split())
	tmp2 = input()

	dic = {}

	for x,y in zip(tmp0,tmp1):
		dic[x] = y

	dic[tmp2] = dic[tmp2] - 1

	print(*dic.values())
 if __name__ == '__main__':

	tmp0 = input().split()
	tmp1 = map(int,input().split())
	tmp2 = input()

	dic = {}

	for x,y in zip(tmp0,tmp1):
		dic[x] = y

	dic[tmp2] = dic[tmp2] - 1

	print(*dic.values()) __name__ == '__main__' __name__ '__main__' tmp0 = input().split() tmp0 input().split() ().split () input split tmp1 = map(int,input().split()) tmp1 map(int,input().split()) map int input().split() ().split () input split tmp2 = input() tmp2 input() input dic = {} dic {} for x,y in zip(tmp0,tmp1):
		dic[x] = y

	 x y zip(tmp0,tmp1) zip tmp0 tmp1 dic[x] = y dic[x] dic x y dic[tmp2] = dic[tmp2] - 1 dic[tmp2] dic tmp2 dic[tmp2] - 1 dic[tmp2] dic tmp2 1 print(*dic.values()) print *dic.values() dic.values() dic.values dic values tmp2 = input() input() tmp2 tmp0 = input().split() input().split() tmp0 tmp1 = map(int,input().split()) map(int,input().split()) tmp1 dic = {} {} dic

if __name__ == '__main__':

	tmp0 = input().split()
	tmp1 = map(int,input().split())
	tmp2 = input()

	dic = {}

	for x,y in zip(tmp0,tmp1):
		dic[x] = y

	dic[tmp2] = dic[tmp2] - 1

	print(*dic.values())

