#include <bits/stdc++.h>
using namespace std;
string s;
int i, n;
int a = 0, b = 0, c = 0;
bool d = false, e = false, f = false, g = false;
int main() {
  cin >> s;
  n = s.length();
  for (i = 0; i < n; i++) {
    if (s[i] == '0') a++;
    if (s[i] == '1') b++;
    if (s[i] == '?') c++;
  }
  if ((a > b) || (a + c > b)) d = true;
  if ((b > a + 1) || (b + c > a + 1)) g = true;
  if (c == 0) {
    if ((a == b) || (b == a + 1)) {
      if (s[n - 1] != '1')
        f = true;
      else
        e = true;
    }
  } else {
    if ((a - b <= c) && (b - a - 1 <= c)) {
      if ((s[n - 1] == '1') ||
          ((b <= a) && (b + c <= a + 1) && (s[n - 1] == '?')))
        e = true;
      else
        f = true;
      if ((s[n - 1] == '?') && (a + c > b)) {
        e = true;
      }
    }
  }
  if (d == true) cout << "00" << endl;
  if (e == true) cout << "01" << endl;
  if (f == true) cout << "10" << endl;
  if (g == true) cout << "11";
  return 0;
}
