P12673 「LAOI-8」Change
Description
You are given two sequences, $A$ and $B$, each containing $n$ distinct integers. In one operation, you may select any pair of indices $(i, j)$ such that $j - i = k$ for some positive integer $k$, and swap $A_i$ and $A_j$. 
It is guaranteed that $A \ne B$, but the sorted sequences of $A$ and $B$ are equal.
Please find all possible $k$ so that $A$ can be transformed into $B$ through several operations.
Input Format
The first line contains an integer $n$.
The second line contains $n$ integers: the initial sequence $A$.
The third line contains $n$ integers: the target sequence $B$.
Output Format
If there are $m$ valid integers $k$, output $m$ lines, each with one positive integer.
Output all valid $k$ in ascending order.
Explanation/Hint
**Subtasks are used in this problem.**
| Subtask | Constraint| Special Property| Score |
| :-: | :-: | :-: | :-----: |
| $1$ | $n \le 7$ | None | $10$ |
|$2$ | $n \le 2000$ | None | $20$ |
| $3$ | $n \le 2 \times 10^5$ | $\texttt a$ | $30$ |
| $4$ | $n \le 2 \times 10^5$ | None | $40$ |
Special Property $\texttt a$: Only two elements differ in position between $A$ and $B$.
For all test cases, it is guaranteed that $3\le n\le 2 \times10^5$, $1\le A_i,B_i \le 10^9$.