#include <bits/stdc++.h>
using namespace std;
long long _r(long long a) {
  if (!a) return 0;
  long long d = 1ll + a * 8;
  long long ds = sqrt(1. * d);
  if (ds * ds != d) return -1;
  long long ans = 1ll + ds;
  if (ans & 1) return -1;
  return ans / 2;
}
void solve() {
  long long a00, a01, a10, a11;
  cin >> a00 >> a01 >> a10 >> a11;
  if (!a00 && !a01 && !a10 && !a11) {
    cout << "0";
    return;
  }
  if (!a00 && !a10 && !a11 && a01 == 1) {
    cout << "01";
    return;
  }
  if (!a00 && !a01 && !a11 && a10 == 1) {
    cout << "10";
    return;
  }
  long long c0 = _r(a00);
  long long c1 = _r(a11);
  if (!a01 && !a10 && !a11 && c0 != -1) {
    string ans = "";
    for (int i = 0; i < c0; i++) ans += '0';
    cout << ans;
    return;
  }
  if (!a01 && !a10 && !a00 && c1 != -1) {
    string ans = "";
    for (int i = 0; i < c1; i++) ans += '1';
    cout << ans;
    return;
  }
  if (c1 == -1 || c0 == -1) {
    cout << "Impossible";
    return;
  }
  if (c1 == 0) {
    if (a10 + a01 != c0) {
      cout << "Impossible";
      return;
    } else {
      string ans = "";
      for (int i = 0; i < a01; i++) ans += '0';
      ans += '1';
      for (int i = 0; i < a10; i++) ans += '0';
      cout << ans;
      return;
    }
  }
  if (c0 == 0) {
    if (a10 + a01 != c1) {
      cout << "Impossible";
      return;
    } else {
      string ans = "";
      for (int i = 0; i < a10; i++) ans += '1';
      ans += '0';
      for (int i = 0; i < a01; i++) ans += '1';
      cout << ans;
      return;
    }
  }
  if (c0 * c1 != a10 + a01) {
    cout << "Impossible";
    return;
  }
  string ans = "";
  int len = c1 + c0;
  for (int i = 0; i < len; i++) {
    if (c0 && a01 >= c1) {
      a01 -= c1;
      c0--;
      ans += '0';
    } else if (c1 && a10 >= c0) {
      a10 -= c0;
      c1--;
      ans += '1';
    }
  }
  cout << ans;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}

### Prompt

Construct a Cpp code solution to the problem outlined:

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;
long long _r(long long a) {
  if (!a) return 0;
  long long d = 1ll + a * 8;
  long long ds = sqrt(1. * d);
  if (ds * ds != d) return -1;
  long long ans = 1ll + ds;
  if (ans & 1) return -1;
  return ans / 2;
}
void solve() {
  long long a00, a01, a10, a11;
  cin >> a00 >> a01 >> a10 >> a11;
  if (!a00 && !a01 && !a10 && !a11) {
    cout << "0";
    return;
  }
  if (!a00 && !a10 && !a11 && a01 == 1) {
    cout << "01";
    return;
  }
  if (!a00 && !a01 && !a11 && a10 == 1) {
    cout << "10";
    return;
  }
  long long c0 = _r(a00);
  long long c1 = _r(a11);
  if (!a01 && !a10 && !a11 && c0 != -1) {
    string ans = "";
    for (int i = 0; i < c0; i++) ans += '0';
    cout << ans;
    return;
  }
  if (!a01 && !a10 && !a00 && c1 != -1) {
    string ans = "";
    for (int i = 0; i < c1; i++) ans += '1';
    cout << ans;
    return;
  }
  if (c1 == -1 || c0 == -1) {
    cout << "Impossible";
    return;
  }
  if (c1 == 0) {
    if (a10 + a01 != c0) {
      cout << "Impossible";
      return;
    } else {
      string ans = "";
      for (int i = 0; i < a01; i++) ans += '0';
      ans += '1';
      for (int i = 0; i < a10; i++) ans += '0';
      cout << ans;
      return;
    }
  }
  if (c0 == 0) {
    if (a10 + a01 != c1) {
      cout << "Impossible";
      return;
    } else {
      string ans = "";
      for (int i = 0; i < a10; i++) ans += '1';
      ans += '0';
      for (int i = 0; i < a01; i++) ans += '1';
      cout << ans;
      return;
    }
  }
  if (c0 * c1 != a10 + a01) {
    cout << "Impossible";
    return;
  }
  string ans = "";
  int len = c1 + c0;
  for (int i = 0; i < len; i++) {
    if (c0 && a01 >= c1) {
      a01 -= c1;
      c0--;
      ans += '0';
    } else if (c1 && a10 >= c0) {
      a10 -= c0;
      c1--;
      ans += '1';
    }
  }
  cout << ans;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}

```