Let be a binary string of length , and let be a nonnegative integer. Define as the following infinite binary sequence:
You are given binary strings . The first character of every string is .
Determine whether nonnegative integers satisfying the following equation exist, and find one such sequence if it exists:
The XOR is taken independently at every position, and the on the right-hand side denotes the infinite all-zero sequence.
Let and . If a solution exists, there always exists one satisfying and . The printed solution must satisfy these conditions.
The input is given from Standard Input in the following format:
case case
Print one line for each test case.
If no solution exists, print -1.
If a solution exists, print integers in the following format:
In the first test case, the two strings cancel without any shift.
In the second test case, applying the printed shifts makes the XOR zero at every position.
The third test case has no valid shifts.
Each case is given in the following format:
The printed integers must satisfy and , and the XOR in the statement must be zero at every position. If there are multiple solutions, print any of them.
0 and 1 ().1 ().