P8589 'JROI-8' Yes, There Are Also Flowers, Girls, and the Milky Way
Background

> "Part 1"\
Even if I turn into bones, there are still things I do not want to forget.
**Reprint permission has been granted.**
Description
Given $n$, construct a binary string of length $n$ containing only $0,1$ such that the numbers of occurrences of $01,00,10,11$ are equal, or report that there is no solution.
Here, an "occurrence" means being exactly the same as a consecutive substring of the original string. For example, in $1011101$, the numbers of occurrences of $01,00,10,11$ are $2,0,2,2$, respectively.
**Note that the large sample is not provided as an attached file, but is placed directly in Sample #3 of the Input/Output Samples.**
Input Format
One line containing a positive integer $n$.
Output Format
If there is a solution, output one line with a length $n$ binary string containing only $0,1$ that satisfies the condition.
If there is no solution, output `-1`.
Explanation/Hint
## Constraints
| Test Point ID | Score | $n\leq$ | Special Property |
| -----------: | -----------: | -----------: | -----------: |
| $1\sim 2$ | $20$ | $5$ | None |
| $3\sim 4$ | $20$ | $10^6$ | $n \bmod 4 = 0$ |
| $5\sim 6$ | $20$ | $20$ | None |
| $7 \sim 10$ | $40$ | $10^6$ | None |
Translated by ChatGPT 5