human
I found an interesting problem on https://codeforces.com/problemset/problem/708/B:
For each string s consisting of characters '0' and '1' one can define four integers a_00, a_01, a_10 and a_11, where a_{xy} is the number of subsequences of length 2 of the string s equal to the sequence {x, y}. 

In these problem you are given four integers a_00, a_01, a_10, a_11 and have to find any non-empty string s that matches them, or determine that there is no such string. One can prove that if at least one answer exists, there exists an answer of length no more than 1 000 000.

-----Input-----

The only line of the input contains four non-negative integers a_00, a_01, a_10 and a_11. Each of them doesn't exceed 10^9.

-----Output-----

If there exists a non-empty string that matches four integers from the input, print it in the only line of the output. Otherwise, print "Impossible". The length of your answer must not exceed 1 000 000.

-----Examples-----
Input
1 2 3 4

Output
Impossible

Input
1 2 2 1

Output
0110

I tried it in Python, but could not do it. Can you solve it?

 ... Give me a Python code to find any non-empty string s that matches them, or determine that there is no such string?
assistant
#Here is Python code to find any non-empty string s that matches them, or determine that there is no such string.

def main():
    from itertools import product
    def f(a):
        x = int((a * 2. + .25) ** .5 + .51)
        if x * (x - 1) != a * 2:
            raise ValueError
        return x

    a00, a01, a10, a11 = list(map(int, input().split()))
    try:
        for b, w in product([f(a00)] if a00 else [1, 0], [f(a11)] if a11 else [1, 0]):
            if b * w == a01 + a10:
                break
        else:
            raise ValueError
    except ValueError:
        print("Impossible")
    else:
        if w:
            a01, rest = divmod(a01, w)
            if rest:
                l = ['0' * a01, '1' * (w - rest), '0', '1' * rest, '0' * (b - a01 - 1)]
            else:
                l = ['0' * a01, '1' * w, '0' * (b - a01)]
        else:
            l = ['0' * b]
        print(''.join(l))

def __starting_point():
    main()

__starting_point()