#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 10;
long long a00, a01, a10, a11;
long long n0, n1, len;
int ans[MAX];
long long c01, c10;
bool found;
void NO() {
  puts("Impossible");
  exit(0);
}
void init() {
  scanf("%lld%lld%lld%lld", &a00, &a01, &a10, &a11);
  n0 = -1;
  n1 = -1;
  for (long long i = 0; i <= 1e5; i++) {
    if (i * (i - 1) / 2 == a00) {
      n0 = i;
    }
    if (i * (i - 1) / 2 == a11) {
      n1 = i;
    }
  }
  found = false;
}
void no_zero() {
  if (a00 == 0 && a01 == 0 && a10 == 0 && n1 > 1) {
    found = true;
    len = n1;
    for (int i = 1; i <= n1; i++) ans[i] = 1;
  }
}
void no_one() {
  if (n0 > 1 && a01 == 0 && a10 == 0 && a11 == 0) {
    found = true;
    len = n0;
    for (int i = 1; i <= n0; i++) ans[i] = 0;
  }
}
void one_zero() {
  if (a00 == 0 && a01 + a10 == n1) {
    found = true;
    len = n1 + 1;
    for (int i = 1; i <= a10; i++) ans[i] = 1;
    ans[a10 + 1] = 0;
    for (int i = a10 + 2; i <= len; i++) ans[i] = 1;
  }
}
void one_one() {
  if (a11 == 0 && a01 + a10 == n0) {
    found = true;
    len = n0 + 1;
    for (int i = 1; i <= a01; i++) ans[i] = 0;
    ans[a01 + 1] = 1;
    for (int i = a01 + 2; i <= len; i++) ans[i] = 0;
  }
}
void normal_case() {
  if (n0 > 1 && n1 > 1 && n0 * n1 == a01 + a10) {
    found = true;
    len = n0 + n1;
    for (int i = 1; i <= n0; i++) ans[i] = 0;
    for (int i = n0 + 1; i <= n0 + n1; i++) ans[i] = 1;
    c01 = n0 * n1;
    c10 = 0;
    int p = n0 + n1;
    while (c01 - a01 >= n1) {
      c01 -= n1;
      c10 += n1;
      swap(ans[p], ans[p - n1]);
      p--;
    }
    p = p - n1;
    swap(ans[p], ans[p + (c01 - a01)]);
  }
}
void print_answer() {
  if (!found)
    printf("Impossible");
  else {
    for (int i = 1; i <= len; i++) printf("%d", ans[i]);
  }
}
int main() {
  init();
  if (a00 + a01 + a10 + a11 == 0) {
    found = true;
    len = 1;
    ans[len] = 0;
  }
  no_zero();
  no_one();
  one_zero();
  one_one();
  normal_case();
  print_answer();
}

### 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 MAX = 1e6 + 10;
long long a00, a01, a10, a11;
long long n0, n1, len;
int ans[MAX];
long long c01, c10;
bool found;
void NO() {
  puts("Impossible");
  exit(0);
}
void init() {
  scanf("%lld%lld%lld%lld", &a00, &a01, &a10, &a11);
  n0 = -1;
  n1 = -1;
  for (long long i = 0; i <= 1e5; i++) {
    if (i * (i - 1) / 2 == a00) {
      n0 = i;
    }
    if (i * (i - 1) / 2 == a11) {
      n1 = i;
    }
  }
  found = false;
}
void no_zero() {
  if (a00 == 0 && a01 == 0 && a10 == 0 && n1 > 1) {
    found = true;
    len = n1;
    for (int i = 1; i <= n1; i++) ans[i] = 1;
  }
}
void no_one() {
  if (n0 > 1 && a01 == 0 && a10 == 0 && a11 == 0) {
    found = true;
    len = n0;
    for (int i = 1; i <= n0; i++) ans[i] = 0;
  }
}
void one_zero() {
  if (a00 == 0 && a01 + a10 == n1) {
    found = true;
    len = n1 + 1;
    for (int i = 1; i <= a10; i++) ans[i] = 1;
    ans[a10 + 1] = 0;
    for (int i = a10 + 2; i <= len; i++) ans[i] = 1;
  }
}
void one_one() {
  if (a11 == 0 && a01 + a10 == n0) {
    found = true;
    len = n0 + 1;
    for (int i = 1; i <= a01; i++) ans[i] = 0;
    ans[a01 + 1] = 1;
    for (int i = a01 + 2; i <= len; i++) ans[i] = 0;
  }
}
void normal_case() {
  if (n0 > 1 && n1 > 1 && n0 * n1 == a01 + a10) {
    found = true;
    len = n0 + n1;
    for (int i = 1; i <= n0; i++) ans[i] = 0;
    for (int i = n0 + 1; i <= n0 + n1; i++) ans[i] = 1;
    c01 = n0 * n1;
    c10 = 0;
    int p = n0 + n1;
    while (c01 - a01 >= n1) {
      c01 -= n1;
      c10 += n1;
      swap(ans[p], ans[p - n1]);
      p--;
    }
    p = p - n1;
    swap(ans[p], ans[p + (c01 - a01)]);
  }
}
void print_answer() {
  if (!found)
    printf("Impossible");
  else {
    for (int i = 1; i <= len; i++) printf("%d", ans[i]);
  }
}
int main() {
  init();
  if (a00 + a01 + a10 + a11 == 0) {
    found = true;
    len = 1;
    ans[len] = 0;
  }
  no_zero();
  no_one();
  one_zero();
  one_one();
  normal_case();
  print_answer();
}

```