#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string second;
  cin >> second;
  int n = (int)second.size();
  int a = 0, b = 0, c = 0;
  for (auto i : second) {
    if (i == '0')
      a++;
    else if (i == '1')
      b++;
    else
      c++;
  }
  if (b == 0 || (b <= (n - 2 + 1) / 2)) {
    cout << "00\n";
  }
  if (second[second.size() - 1] != '0') {
    if (second[second.size() - 1] == '?') {
      c--;
      b++;
    }
    for (int i = 0; i <= c; ++i) {
      if (a + i > (n - 2) / 2 && b + (c - i) > (n - 2 + 1) / 2) {
        cout << "01\n";
        if (second[second.size() - 1] == '?') {
          c++;
          b--;
        }
        break;
      }
    }
    if (second[second.size() - 1] == '?') {
      c++;
      b--;
    }
  }
  if (second[second.size() - 1] != '1') {
    if (second[second.size() - 1] == '?') {
      c--;
      a++;
    }
    for (int i = 0; i <= c; ++i) {
      if (a + i > (n - 2) / 2 && b + (c - i) > (n - 2 + 1) / 2) {
        cout << "10\n";
        if (second[second.size() - 1] == '?') {
          c++;
          a--;
        }
        break;
      }
    }
    if (second[second.size() - 1] == '?') {
      c++;
      a--;
    }
  }
  if (a == 0 || (a <= (n - 2) / 2)) {
    cout << "11\n";
  }
  cout << '\n';
  return 0;
}
