#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
int a, b, c;
char s[100007];
int main() {
  int n;
  a = b = c = 0;
  ios::sync_with_stdio(false);
  cin >> s;
  n = strlen(s);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') ++b;
    if (s[i] == '0') ++a;
    if (s[i] == '?') ++c;
  }
  if (n & 1) {
    int st = (n - 1) / 2;
    if (b <= st) cout << "00\n";
    if (b + c >= st + 1 && a + c >= st) {
      if (s[n - 1] == '1' || (s[n - 1] == '?' && a + c > st)) cout << "01\n";
      if (s[n - 1] == '0' || (s[n - 1] == '?' && b + c > st + 1))
        cout << "10\n";
    }
    if (a < st) cout << "11\n";
  } else {
    if (b < a + c) cout << "00\n";
    if (a + c >= n / 2 && b + c >= n / 2) {
      if (s[n - 1] == '1' || (s[n - 1] == '?' && a + c > n / 2)) cout << "01\n";
      if (s[n - 1] == '0' || (s[n - 1] == '?' && b + c > n / 2)) cout << "10\n";
    }
    if (a < b + c) cout << "11\n";
  }
  return 0;
}
