#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void checkmax(T& a, const T& b) {
  if (a < b) a = b;
}
template <typename T>
inline void checkmin(T& a, const T& b) {
  if (a > b) a = b;
}
inline int lowbit(int x) { return x & -x; }
unsigned rand32() { return (rand() << 16) + rand(); }
int rand(int a, int b) { return rand32() % (b - a + 1) + a; }
double drand01() { return fabs(rand32()) / INT_MAX; }
const double eps = 1e-8;
int dcmp(double x) { return x < -eps ? -1 : x > eps; }
bool deq(double x, double y) { return dcmp(x - y) == 0; }
bool dleq(double x, double y) { return dcmp(x - y) <= 0; }
template <typename T>
inline T sqr(const T& x) {
  return x * x;
}
char s[1000000];
int main() {
  while (scanf("%s", s) == 1) {
    vector<int> v1, v0, vq;
    vector<string> res;
    for (char* p = s; *p; p++) {
      if (*p == '1') {
        v1.push_back(p - s);
      } else if (*p == '0') {
        v0.push_back(p - s);
      } else if (*p == '?') {
        vq.push_back(p - s);
      }
    }
    int n = strlen(s);
    int p = (n - 2) / 2;
    int m = n - 2 - p;
    if (v0.size() + vq.size() >= p + 2) {
      res.push_back("00");
    }
    if (v1.size() + vq.size() >= m + 2) {
      res.push_back("11");
    }
    if (v1.size() + vq.size() >= m + 1 && v0.size() + vq.size() >= p + 1) {
      do {
        vector<int> v0_1(v0), vq_1(vq), v1_1(v1);
        while (v0_1.size() < p + 1) {
          v0_1.push_back(vq_1.back());
          vq_1.pop_back();
        }
        while (v1_1.size() < m + 1) {
          v1_1.push_back(vq_1.back());
          vq_1.pop_back();
        }
        sort(v0_1.begin(), v0_1.end());
        sort(v1_1.begin(), v1_1.end());
        if (v0_1.back() < v1_1.back()) {
          res.push_back("01");
        } else {
          res.push_back("10");
        }
      } while (0);
      do {
        vector<int> v0_2(v0), vq_2(vq), v1_2(v1);
        while (v1_2.size() < m + 1) {
          v1_2.push_back(vq_2.back());
          vq_2.pop_back();
        }
        while (v0_2.size() < p + 1) {
          v0_2.push_back(vq_2.back());
          vq_2.pop_back();
        }
        sort(v0_2.begin(), v0_2.end());
        sort(v1_2.begin(), v1_2.end());
        if (v0_2.back() < v1_2.back()) {
          res.push_back("01");
        } else {
          res.push_back("10");
        }
      } while (0);
    }
    sort(res.begin(), res.end());
    vector<string>::iterator iter = unique(res.begin(), res.end());
    for (vector<string>::iterator i = res.begin(); i != iter; i++) {
      cout << *i << endl;
    }
  }
}
