Three permutations of length are given. Each permutation contains every integer from to exactly once.
A permutation of length is called good if it satisfies the following condition.
There are queries. Each query swaps two adjacent elements in one of the three permutations. The changes made by previous queries remain in effect.
Immediately after each query, determine whether a good permutation exists for the current .
The input is given from Standard Input in the following format:
For each query of each test case, print YES if a good permutation exists immediately after the query, and print NO otherwise. Print one answer per line.
Each case is given in the following format:
In the -th query, if swap the -th and -th elements of ; if , do the same in ; if , do the same in .
| 3 | 60 | No additional constraints. |