#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
char s[100005];
int len;
bool equable(int a, int b, int c) {
  if (len % 2 == 0) {
    if (a + c >= b && a <= b + c) return true;
    return false;
  } else {
    if (a + c >= b - 1 && a <= b - 1 + c) return true;
    return false;
  }
}
int main() {
  scanf("%s", s);
  len = strlen(s);
  int a = 0, b = 0, c = 0;
  for (int i = 0; i < len; ++i) {
    if (s[i] == '0') ++a;
    if (s[i] == '1') ++b;
  }
  int zero = -1, one = -1, que = -1;
  for (int i = 0; i < len; ++i) {
    if (s[i] == '0') zero = i;
    if (s[i] == '1') one = i;
    if (s[i] == '?') que = i;
  }
  c = len - a - b;
  vector<string> ans;
  {
    if (len % 2 == 0) {
      if (a + c >= 2 + b) ans.push_back("00");
    } else {
      if (a + c >= 2 + b - 1) ans.push_back("00");
    }
  }
  if (equable(a, b, c)) {
    {
      if (max(que, zero) < one)
        ans.push_back("01");
      else if (max(one, zero) < que) {
        if (equable(a, b + 1, c - 1)) ans.push_back("01");
      }
    }
    {
      if (max(que, one) < zero)
        ans.push_back("10");
      else if (max(one, zero) < que) {
        if (equable(a + 1, b, c - 1)) ans.push_back("10");
      }
    }
  }
  {
    if (len % 2 == 0) {
      if (b + c >= 2 + a) ans.push_back("11");
    } else {
      if (b + c - 1 >= 2 + a) ans.push_back("11");
    }
  }
  for (int i = 0; i < ans.size(); ++i) printf("%s\n", ans[i].c_str());
  return 0;
}
