J. Modular Transform
time limit per test
4 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Given two arrays $$$a$$$ and $$$b$$$ of length n consisting of values $$$0, 1, 2, 3$$$ and $$$4$$$ you can do the following operation at most $$$8 \cdot n$$$ times:

Choose an index $$$i$$$ and let $$$a[i] := (a[i - 1] + a[i] + a[i + 1]) \mod 5$$$.

All the operations on indices are modulo $$$n$$$.

Check if it is possible to make both arrays equal.

Input

The first line of the input contains single number $$$n$$$ ($$$5 \leq n \leq 10^5$$$)  — the length of both arrays.

The second line contains $$$n$$$ numbers $$$a_0, a_1 ... a_{n - 1}$$$ ($$$0 \leq a_i \leq 4$$$)  — elements of an array.

The third line contains analogous description of array $$$b$$$.

Output

If it is not possible to make both arrays equal output $$$-1$$$.

If it is possible to make both arrays equal the first line should contain $$$0 \leq k \leq 8 \cdot n$$$  — the number of operations.

The following $$$k$$$ lines each should contain a single number $$$0 \leq t_i \leq n - 1$$$  — the index chosen in the $$$i$$$-th operation.

Example
Input
5
1 0 0 1 0
1 0 0 1 1
Output
3
4
4
4