#include <bits/stdc++.h>
using namespace std;
const int oo = 1 << 20;
const int maxn = 4;
long long A[maxn];
long long get(long long a) {
  if (a == 0) return 1;
  long long ini = 1, fin = oo;
  while (ini <= fin) {
    long long mit = (ini + fin) >> 1;
    long long tmp = mit * (mit - 1) / 2;
    if (tmp == a) {
      return mit;
    } else if (tmp > a)
      fin = mit - 1;
    else
      ini = mit + 1;
  }
  return -1;
}
void solve(long long unos, long long ceros, int otro = 0) {
  long long cnt1 = A[1], cnt2 = A[2];
  if (otro) swap(cnt1, cnt2);
  string res = "";
  for (int i = unos; i >= 0; i--) {
    while (cnt1 - i >= 0 && ceros) {
      res += '0';
      ceros--;
      cnt1 -= i;
      cnt2 -= unos - i;
    }
    if (i) res += '1';
  }
  if (cnt1 == 0 && cnt2 == 0) {
    if (otro) reverse((res).begin(), (res).end());
    cout << res << '\n';
    exit(0);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for (int i = 0; i < 4; i++) cin >> A[i];
  long long unos = get(A[3]);
  long long ceros = get(A[0]);
  if (unos == -1 || ceros == -1) {
    cout << "Impossible\n";
    return 0;
  }
  if ((A[0] && !A[1] && !A[2] && !A[3]) || (!A[0] && !A[1] && !A[2] && A[3])) {
    if (A[0]) unos = 0;
    if (A[3]) ceros = 0;
    while (unos--) cout << '1';
    while (ceros--) cout << '0';
    cout << '\n';
    return 0;
  }
  if (!A[0] && !A[1] && !A[2] && !A[3]) {
    cout << 1 << '\n';
    return 0;
  }
  solve(unos, ceros);
  solve(unos, ceros, 1);
  cout << "Impossible\n";
  return 0;
}

### Prompt

Please provide a cpp coded solution to the problem described below:

For each string s consisting of characters '0' and '1' one can define four integers a00, a01, a10 and a11, where axy 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 a00, a01, a10, a11 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 a00, a01, a10 and a11. Each of them doesn't exceed 109.

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

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int oo = 1 << 20;
const int maxn = 4;
long long A[maxn];
long long get(long long a) {
  if (a == 0) return 1;
  long long ini = 1, fin = oo;
  while (ini <= fin) {
    long long mit = (ini + fin) >> 1;
    long long tmp = mit * (mit - 1) / 2;
    if (tmp == a) {
      return mit;
    } else if (tmp > a)
      fin = mit - 1;
    else
      ini = mit + 1;
  }
  return -1;
}
void solve(long long unos, long long ceros, int otro = 0) {
  long long cnt1 = A[1], cnt2 = A[2];
  if (otro) swap(cnt1, cnt2);
  string res = "";
  for (int i = unos; i >= 0; i--) {
    while (cnt1 - i >= 0 && ceros) {
      res += '0';
      ceros--;
      cnt1 -= i;
      cnt2 -= unos - i;
    }
    if (i) res += '1';
  }
  if (cnt1 == 0 && cnt2 == 0) {
    if (otro) reverse((res).begin(), (res).end());
    cout << res << '\n';
    exit(0);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for (int i = 0; i < 4; i++) cin >> A[i];
  long long unos = get(A[3]);
  long long ceros = get(A[0]);
  if (unos == -1 || ceros == -1) {
    cout << "Impossible\n";
    return 0;
  }
  if ((A[0] && !A[1] && !A[2] && !A[3]) || (!A[0] && !A[1] && !A[2] && A[3])) {
    if (A[0]) unos = 0;
    if (A[3]) ceros = 0;
    while (unos--) cout << '1';
    while (ceros--) cout << '0';
    cout << '\n';
    return 0;
  }
  if (!A[0] && !A[1] && !A[2] && !A[3]) {
    cout << 1 << '\n';
    return 0;
  }
  solve(unos, ceros);
  solve(unos, ceros, 1);
  cout << "Impossible\n";
  return 0;
}

```