Let $x$ be an integer represented by $n$ identical digits $a$ in base $r$. Also, let $y$ be an integer whose representation consists of $m$ digits $b$ in base $r$.
Find the sum of the digits of the number $z = x \cdot y$ represented in base $r$, and also output this sum of digits in base $r$.
Input
The first line contains a single integer $t$ ($1 \le t \le 10\,000$): the number of test cases. The description of the test cases follows.
Each test case consists of a single line containing five integers $n, m, a, b, r$ ($n, m \ge 1, n + m \le 10^{18}, 1 \le a, b < r \le 10$).
Output
For each test case, output a single integer on a separate line: the answer to the problem in base $r$.
Example
Sample Input 1
5 2 3 6 6 10 6 11 7 7 10 20 25 2 6 10 13 37 1 1 2 57 1 4 2 8
Sample Output 1
27 84 204 100101 71
Note
In the first test case, we have $x = 66_{10}, y = 666_{10}, z = 43\,956_{10}$. The sum of the digits of $z$ is $27_{10}$.
In the fourth test case, the sum of the digits of $z$ in binary representation is $37_{10} = 100101_2$.