#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long INF = 1e18;
long long n, a, b, c;
string s;
bool ok[4];
void print() {
  if (ok[0]) puts("00");
  if (ok[1]) puts("01");
  if (ok[2]) puts("10");
  if (ok[3]) puts("11");
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  n = s.length();
  char lst = s[n - 1];
  for (auto &ch : s) {
    switch (ch) {
      case '1':
        a++;
        break;
      case '0':
        b++;
        break;
      case '?':
        c++;
        break;
    }
  }
  if (b + c > a) {
    ok[0] = true;
  }
  if (a + c > b + 1) {
    ok[3] = true;
  }
  if (!c) {
    if (a == b or a == b + 1) {
      (lst == '1' ? ok[1] = true : ok[2] = true);
    }
    print();
    return 0;
  }
  if (lst != '0') {
    long long aa = a, bb = b, cc = c;
    if (lst == '?') {
      cc--, aa++;
    }
    long long x = (bb + cc + (n & 1) - aa) / 2;
    if (x >= 0 and x <= cc and aa + x == bb + cc - x + (n & 1)) {
      ok[1] = true;
    }
  }
  if (lst != '1') {
    long long aa = a, bb = b, cc = c;
    if (lst == '?') {
      cc--, bb++;
    }
    long long x = (bb + cc + (n & 1) - aa) / 2;
    if (x >= 0 and x <= cc and aa + x == bb + cc - x + (n & 1)) {
      ok[2] = true;
    }
  }
  print();
  return 0;
}
