The hamster Shustrik received an unusual calculator as a gift from the hedgehog Shurshik. Initially, the number $$$A$$$ is displayed on the calculator screen.
The instructions for the calculator specify a fixed number $$$M$$$. All arithmetic operations are performed with this number. Additionally, Shurshik has thought of numbers $$$N$$$ and $$$B$$$ and informed Shustrik about them.
The calculator can perform only four operations, and in one step, one of the following operations can be applied:
After performing some (possibly empty) sequence of operations, the number $$$A'$$$ will be obtained.
The hedgehog Shurshik became curious whether Shustrik can obtain such a number $$$A'$$$ that
$$$$$$ A' \equiv B \pmod N. $$$$$$
In other words, the numbers $$$A'$$$ and $$$B$$$ must have the same remainders when divided by $$$N$$$.
Your task is to help the hamster find any sequence of operations of the smallest length, after which the specified condition will be satisfied, or determine that it is impossible to obtain such a number.
In a single line, four integers are given separated by spaces: $$$A$$$, $$$M$$$, $$$B$$$, and $$$N$$$ ($$$|A| \leq 10^9$$$, $$$1 \leq M \leq 10^9$$$, $$$0 \leq B \lt N \leq 2 \cdot 10^6$$$).
If the desired sequence of operations does not exist, output "-1" in a single line.
Otherwise, in the first line, output the length $$$x$$$ of the minimal suitable sequence. In the second line, output a string of length $$$x$$$ consisting of the characters "+", "-", "*", and "%" — the sequence of operations that transforms the initial $$$A$$$ into such $$$A'$$$ that $$$A' \equiv B \pmod N$$$.
If there are multiple such sequences, output any of them.
It can be proven that the length of the answer does not exceed $$$N$$$.
Points for each subtask are awarded only if all tests for that subtask and necessary subtasks are successfully passed.
| Group | Points | Additional constraints | Required groups |
| 1 | 7 | $$$|A|, M, N \le 8$$$ | – |
| 2 | 6 | $$$M = 1$$$ | – |
| 3 | 8 | $$$M = N$$$ | – |
| 4 | 12 | $$$M \equiv 0 \pmod N$$$ | 3 |
| 5 | 15 | $$$N \equiv 0 \pmod M$$$ | 2–3 |
| 6 | 16 | $$$N \cdot M \le 2 \cdot 10^{6}$$$ | 1–2 |
| 7 | 18 | $$$A = 0$$$ | – |
| 8 | 18 | – | 1–7 |
1 3 2 5
2 +*
6 7 2 4
0
-1 3 2 4
1 +
5 6 1 6
-1
0 6 3 7
3 ---
5 9 1 8
3 *%+
Consider the answer to the first example of the input data: