1479 - 表达式

Input

Output

Examples

Input

x1 x2 & x3 |
3
1 0 1
3
1
2
3

Output

1
1
0

Hint

x1 ! x2 x4 | x3 x5 ! & & ! &
5
0 1 0 1 1
3
1
3

	5




	--------------------------
0
1
1

Source

noip2020

Time Limit 1 second
Memory Limit 256 MB
Discuss Stats
上一题 下一题