#P6646. A + B = C
A + B = C
Problem Description
Hi everyone! Welcome to the Stage 7 of this series of training contests. Cuber QQ is the problem settler of this contest; he has prepared 11 problems for you and wishes you to enjoy it. Good luck!
As the first problem of this contest, Cuber QQ thought that it's reasonable to start with an easy one, so he modified the famous A + B problem by a little bit, so that it's easy enough but not that trivial.
Given $a, b, c$ , find an arbitrary set of $x, y, z$ such that $a\cdot 10^x+b\cdot 10^y=c\cdot 10^z$ and $0 \le x, y, z \le 10^6$.
Input
The input consists of multiple test cases, starting with an integer $t$ ($1 \le t \le 100$), denoting the number of test cases.
For each test case, there are three space-separated integers, $a, b, c$ respectively ($1 \le a, b, c \le 10^{100000}$).
Output
For each test case, please output three space-separated integers $x, y, z$. If there are multiple solutions, print any of them.
In case there are no solutions, please output $-1$ as a single line.
3
23 39 62
2 31 51
1 1 1
0 0 0
1 0 0
-1
Hint
HDOJ may give ambiguous feedback due to the compatibility issue of our checker. If you see "System Error", please think of it as "Wrong Answer".