#include <bits/stdc++.h>
using namespace std;
char word[100009];
int size;
bool unocero(int unos, int ceros, int des) {
  if (word[size - 1] == '1') return false;
  int x = (ceros + des - unos + size % 2) / 2;
  if (x >= 0 && x <= des) return true;
  return false;
}
bool cerouno(int unos, int ceros, int des) {
  if (word[size - 1] == '0') return false;
  int x = (ceros + des - unos + size % 2) / 2;
  if (x >= 0 && x <= des) return true;
  return false;
}
int main() {
  int unos = 0;
  int ceros = 0;
  int des = 0;
  cin >> word;
  size = strlen(word);
  for (int i = 0; i < size; i++) {
    if (word[i] == '1')
      unos++;
    else if (word[i] == '0')
      ceros++;
    else
      des++;
  }
  if (ceros + des >= unos + 1) {
    cout << "00" << endl;
  }
  if (true) {
    if (word[size - 1] == '?') {
      if (cerouno(unos + 1, ceros, des - 1)) cout << "01" << endl;
    } else {
      if (cerouno(unos, ceros, des)) cout << "01" << endl;
    }
  }
  if (true) {
    if (word[size - 1] == '?') {
      if (unocero(unos, ceros + 1, des - 1)) cout << "10" << endl;
    } else {
      if (unocero(unos, ceros, des)) cout << "10" << endl;
    }
  }
  if (unos + des >= ceros + 2) {
    cout << "11" << endl;
  }
  return 0;
}
