#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
char s[N];
int n;
int cnt0, cnt1, cntw;
vector<string> ans;
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i < n; ++i) {
    if (s[i] == '0')
      cnt0++;
    else if (s[i] == '1')
      cnt1++;
    else if (s[i] == '?')
      cntw++;
  }
  int a = (n - 1) / 2;
  int b = n - 2 - a;
  if (cnt1 <= a) {
    ans.push_back("00");
  }
  if (cnt0 <= b) {
    ans.push_back("11");
  }
  int da = a + 1 - cnt1;
  int db = b + 1 - cnt0;
  if (da >= 0 && db >= 0) {
    if (s[n - 1] == '0') {
      ans.push_back("10");
    } else if (s[n - 1] == '1') {
      ans.push_back("01");
    } else if (s[n - 1] == '?') {
      if (db > 0) ans.push_back("10");
      if (da > 0) ans.push_back("01");
    }
  }
  sort(ans.begin(), ans.end());
  ans.erase(unique(ans.begin(), ans.end()), ans.end());
  for (int i = 0; i < ans.size(); ++i) {
    printf("%s\n", ans[i].c_str());
  }
  return 0;
}
