Time limit
2s
Memory limit
128 MB
Youngsik and Minsik are sharing a cake. Whenever someone takes a turn, that person eats exactly half of the cake that remains.
If they alternate in the order Youngsik, Minsik, Youngsik eats the following amounts.
| Youngsik | Minsik |
|---|---|
| 1/2 | 1/4 |
| 1/8 | 1/16 |
| 1/32 | 1/64 |
| 1/128 | 1/256 |
| ... | ... |
In this case, Youngsik eats 2/3 of the whole cake, and Minsik eats 1/3.
Now the two brothers will repeat a fixed pattern forever. Each character of the pattern represents one turn; after the last character, the pattern starts again from the beginning. Youngsik is written as *, and Minsik is written as -.
For the repeated pattern Youngsik, Minsik, Youngsik, the amounts are taken as follows.
| Youngsik | Minsik | Youngsik |
|---|---|---|
| 1/2 | 1/4 | 1/8 |
| 1/16 | 1/32 | 1/64 |
| 1/128 | 1/256 | 1/512 |
| ... | ... | ... |
With this pattern, Youngsik eats 5/7 of the whole cake.
You are given the target amount of cake Youngsik must eat as a reduced fraction a/b. Find the shortest repeating pattern that makes Youngsik eat exactly that amount.
The first line contains two integers a and b. They are the numerator and denominator of the reduced fraction a/b.
Print the eating pattern on the first line. In the pattern, print Youngsik's turns as * and Minsik's turns as -.
If no pattern of length at most 60 exists, print -1. If multiple patterns are possible, print the shortest one.
0 <= a <= b <= 2^63 - 1a and b are relatively prime.