For given multisets \(A\) and \(B\), find minimum non-negative \(x\) which \(A \oplus x = B\).
Note that for \(A = \{a_1, a_2, \ldots, a_n\}\), \(A \oplus x = \{a_1 \oplus x, a_2 \oplus x, \ldots, a_n \oplus x\}\). \(\oplus\) stands for exclusive-or.
The first line contains a integer \(n\), which denotes the size of set \(A\) (also for \(B\)).
The second line contains \(n\) integers \(a_1, a_2, \ldots, a_n\), which denote the set \(A\).
The thrid line contains \(n\) integers \(b_1, b_2, \ldots, b_n\), which denote the set \(B\).
(\(1 \leq n \leq 10^5\), \(n\) is odd, \(0 \leq a_i, b_i < 2^{30}\))
The only integer denotes the minimum \(x\). Print \(-1\) if no such \(x\) exists.
3
0 1 3
1 2 3
2