#include <bits/stdc++.h>
using namespace std;
char data[100010];
bool ck1(int x0, int x1, int w) {
  return (x0 - x1 + w >= 0) && (x0 - x1 - w <= 0);
}
bool ck2(int x0, int x1, int w) {
  return (x0 - x1 + w + 1 >= 0) && (x0 - x1 + 1 - w <= 0);
}
int main() {
  while (scanf("%s", data) != EOF) {
    int x0 = 0, x1 = 0, w = 0, i;
    int len = strlen(data);
    bool b01 = false, b10 = false;
    char last;
    last = data[len - 1];
    for (i = 0; i < len; i++) {
      if (data[i] == '1') x1++;
      if (data[i] == '0') x0++;
      if (data[i] == '?') w++;
    }
    if (x0 + w > x1) printf("00\n");
    if (last != '?') {
      if (ck1(x0, x1, w) || ck2(x0, x1, w)) {
        if (last == '1') b01 = true;
        if (last == '0') b10 = true;
      }
    } else {
      if (ck1(x0 + 1, x1, w - 1) || ck2(x0 + 1, x1, w - 1)) b10 = true;
      if (ck1(x0, x1 + 1, w - 1) || ck2(x0, x1 + 1, w - 1)) b01 = true;
    }
    if (b01) printf("01\n");
    if (b10) printf("10\n");
    if (x1 + w > x0 + 1) printf("11\n");
  }
  return 0;
}
