A factory produces three kinds of parts: A, B, and C. Each day it makes $a$ parts of type A, $b$ of type B, and $c$ of type C. The parts are numbered consecutively starting from 1 as follows.
Not every part is made perfectly, so some parts may be defective. Every day the factory inspects parts as follows.
The inspection is extremely precise, so a broken part mixed in never passes by chance. In other words, the three parts used in any passing inspection are guaranteed to all be good.
However, the person in charge is lazy and sometimes stops before running enough inspections. Given the list of inspection results for one day, determine, for each part, which of the following three it is.
The first line contains the number of type A parts $a$, the number of type B parts $b$, and the number of type C parts $c$, separated by spaces. ($1 \le a, b, c \le 100$)
The second line contains the number of inspections $N$. ($1 \le N \le 1000$)
Each of the next $N$ lines describes one inspection result. Each line contains the type A part number $i$, the type B part number $j$, the type C part number $k$, and the inspection result $r$, separated by spaces. $r = 1$ means PASS and $r = 0$ means FAIL.
Part numbers use the global numbering defined above, so $1 \le i \le a$, $a+1 \le j \le a+b$, and $a+b+1 \le k \le a+b+c$.
Print, over $a+b+c$ lines, the verdict for each part from part 1 to part $a+b+c$, one per line.
0 if the part is broken1 if the part is good2 if it cannot be determined whether the part is good or broken