#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int zero = 0, one = 0, q = 0;
  int zi = -1, oi = -1, qi = -1, lqi = -1;
  for (int i = 0; i < n; ++i)
    if (s[i] == '0') {
      ++zero;
      zi = i;
    } else if (s[i] == '1') {
      ++one;
      oi = i;
    } else {
      ++q;
      qi = i;
    }
  vector<string> ans;
  if (one + q >= zero + 2) {
    ans.push_back("11");
  }
  if (zero + q >= one + 1) {
    ans.push_back("00");
  }
  int diff = one - zero;
  bool can = false;
  if (abs(diff) <= q && (abs(diff) & 1) == (q & 1)) {
    can = true;
  }
  if (!can) diff--;
  if (abs(diff) <= q && (abs(diff) & 1) == (q & 1)) {
    can = true;
  }
  if (can) {
    int q2 = (diff + q) / 2;
    int q1 = q - q2;
    int lq = zi;
    for (int i = 0; i < n && q2 > 0; ++i)
      if (s[i] == '?') {
        --q2;
        if (q2 == 0) lq = max(lq, i);
      }
    if (lq < oi || lq < qi) ans.push_back("01");
    lq = oi;
    for (int i = 0; i < n && q1 > 0; ++i)
      if (s[i] == '?') {
        --q1;
        if (q1 == 0) lq = max(lq, i);
      }
    if (lq < zi || lq < qi) ans.push_back("10");
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i] << "\n";
  }
  return 0;
}
