#include <bits/stdc++.h>
using namespace std;
string imput;
int one, zero, mark, n;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> imput;
  n = imput.size();
  one = 0;
  zero = 0;
  mark = 0;
  for (int i = 0; i < n; i++) {
    if (imput[i] == '1') one++;
    if (imput[i] == '0') zero++;
    if (imput[i] == '?') mark++;
  }
  int moves2 = (n - 2) / 2;
  int moves1 = (n - 2) - moves2;
  if (moves1 >= one) cout << "00\n";
  bool possible = false;
  for (int i = 0; i <= mark; i++) {
    zero += i;
    one += (mark - i);
    if (moves1 == one - 1 && moves2 == zero - 1) {
      if (imput[n - 1] == '1' || (imput[n - 1] == '?' && (mark - i) > 0))
        possible = true;
    }
    zero -= i;
    one -= (mark - i);
  }
  if (possible) cout << "01\n";
  ;
  possible = false;
  for (int i = 0; i <= mark; i++) {
    zero += i;
    one += (mark - i);
    if (moves1 == one - 1 && moves2 == zero - 1) {
      if (imput[n - 1] == '0' || (imput[n - 1] == '?' && i > 0))
        possible = true;
    }
    zero -= i;
    one -= (mark - i);
  }
  if (possible) cout << "10\n";
  if (moves2 >= zero) cout << "11\n";
  return 0;
}
