#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int inf = (int)1e9;
const int MAX_N = 100 + 10;
string s = "";
string f(int ex1, int ex0, bool more_zero) {
  string ss = s;
  for (int i = 0; i < ((int)ss.size()); i++) {
    if (ss[i] == '?') {
      if ((more_zero ? ex0 : ex1) > 0) {
        ss[i] = (more_zero ? '0' : '1');
        ex0 -= more_zero;
        ex1 -= !more_zero;
      } else if ((!more_zero ? ex0 : ex1) > 0) {
        ss[i] = (!more_zero ? '0' : '1');
        ex0 -= !more_zero;
        ex1 -= more_zero;
      }
    }
  }
  if (((int)ss.size()) % 2) {
    for (int i = 0; i < ((int)ss.size()); i++) {
      if (ss[i] == '1') {
        ss.erase(ss.begin() + i);
        break;
      }
    }
  }
  return ss;
}
void cal(string ss, vector<string> &ret) {
  int c = 0;
  int sw = 0;
  for (int i = 0; i < ((int)ss.size()) - 2; i++) {
    c += (ss[i] == '0' ? +1 : -1);
    if (c == 0) sw = 0;
    if (c > 0) sw = 1;
    if (c < 0) sw = -1;
  }
  if (sw == 0) {
    ret.push_back(ss.substr(((int)ss.size()) - 2));
  } else if (sw == 1) {
    ret.push_back("01");
  } else {
    ret.push_back("10");
  }
}
void cal() {
  vector<string> ret;
  int zero = count(s.begin(), s.end(), '0');
  int one = count(s.begin(), s.end(), '1');
  int q = count(s.begin(), s.end(), '?');
  int req1 = (((int)s.size()) - 2) / 2 + (((int)s.size()) % 2) + 1;
  int req0 = (((int)s.size()) - 2) / 2 + 1;
  if (one + q > req1) ret.push_back("11");
  if (zero + q > req0) ret.push_back("00");
  if (one <= req1 && zero <= req0) {
    int ex1 = req1 - one;
    int ex0 = req0 - zero;
    cal(f(ex1, ex0, 0), ret);
    cal(f(ex1, ex0, 1), ret);
  }
  set<string> S;
  S.insert(ret.begin(), ret.end());
  for (set<string>::iterator it = S.begin(); it != S.end(); it++) {
    cout << *it << endl;
  }
}
int main() {
  cin >> s;
  cal();
  return 0;
}
