National Olympiad in Informatics, China, 1999
Given 7 positive integers , , , , , , , determine a 01 sequence , such that:
- or for .
- For any of 's length consecutive subsequence , the number of 0's must be between and , inclusive.
- For any of 's length consecutive subsequence , the number of 1's must be between and , inclusive.
For example, if , , , , , , , then a sequence that satisfies the above conditions is .
Input Specification
The input will consist of one line with 7 space-separated positive integers, the values , , , , , , .
Output Specification
The output should consist of one line. If there does not exist a 01
sequence satisfying the above conditions, then output -1
.
Otherwise, output any 01 sequence that satisfies the conditions.
Sample Input
6 1 2 3 1 1 2
Sample Output
010101
Problem translated to English by .
Comments