PivotOJ

Jumbled String

시간 제한: 1000ms메모리 제한: 512MB출처: NCPC 2018BOJ 16324

문제

Recall that a subsequence of a string is any string obtained by removing some subset of characters from the string, for instance “string”, “sing”, “i” and “sg” are all subsequences of “string”. If the same subsequence can be obtained in exactly t different ways, by removing different subsets of characters, we say that the subsequence occurs t times.

Jingfei wants to create a nonempty bit string that has the following properties:

  1. the subsequence 00 occurs a times,
  2. the subsequence 01 occurs b times,
  3. the subsequence 10 occurs c times, and
  4. the subsequence 11 occurs d times.

However, Jingfei does not know how to create such a string – or whether it is even possible. Could you help her?

입력

The input consists of a single line with four integers a, b, c, and d (0 ≤ a, b, c, d ≤ 109).

출력

Output a bit string that satisfies the given requirements. If there are several solutions, output any one of them. If there are no solutions, output “impossible”.

예제

예제 1

입력
3 4 2 1
출력
01001

예제 2

입력
5 0 0 5
출력
impossible
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.