The input consists of multiple datasets. The first line consists a positive integer $T$, representing the number of datasets.
The next $3T$ lines follow, each $3$ lines form a dataset. On the first line of a dataset lies a positive integer $n$. The second line contains $n$ integers $a_0, a_1, ..., a_{n-1}$, which is in the range of $[0,2]$. The third line contains $n$ integers $b_0, b_1, ..., b_{n-1}$, which is also in the range of $[0,2]$.
For pretest, $T=25, n\le 50 000$. For $92\%$ of the test cases, $n\le 100$.
For final test, $T=100, n\le 50000$. For $95\%$ of the test cases, $n\le 200$. For $97\%$ of the test cases, $n\le 10^4$.