You are given two arrays of non-negative integers a_1,a_2,…,a_N and b_1,b_2,…,b_N.
You can perform the following operation several times:
Expression x⊕y means bitwise xor of two numbers x and y.
In binary representation, if the i-th digit of x and y is equal, then the i-th digit of x⊕y is 0, and if not, it is 1.
The given operation exists in all modern programming languages. For example, in C++ and Java, it is represented as x ∧ y.
You want to convert a_i to b_i by performing the minimum number of operations.
Find the minimum number of operations to convert a_i to b_i.
If you cannot convert a_i to b_i with the given operation, print −1.
The first line contains an integer N, where N denotes the length of the two sequences.
The second line contains N space-separated non-negative integers a_1,a_2,…,a_N.
The third line contains N space-separated non-negative integers b_1,b_2,…,b_N.
Print −1, if it is impossible to change the sequence a_i to b_i.
Otherwise, print the minimum number of operations needed to change the sequence a_i to b_i.