#include <bits/stdc++.h>
using namespace std;
string s;
int l, ones, zeros, qs;
bool zz, zo, oz, oo;
int main() {
  zz = zo = oz = oo = false;
  cin >> s;
  l = s.length();
  for (int i = 0; i < l; i++) {
    if (s[i] == '0')
      zeros++;
    else if (s[i] == '1')
      ones++;
    else
      qs++;
  }
  if (l % 2) {
    for (int q = 0; q <= qs; q++) {
      if (zeros + q + 1 > ones + qs - q) zz = true;
      if (zeros + q + 1 < ones + qs - q) oo = true;
      if (zeros + q + 1 == ones + qs - q) {
        if (s[l - 1] == '0' || s[l - 1] == '?' && q >= 1) {
          oz = true;
        }
        if (s[l - 1] == '1' || s[l - 1] == '?' && qs - q >= 1) {
          zo = true;
        }
      }
    }
  } else {
    for (int q = 0; q <= qs; q++) {
      if (zeros + q > ones + qs - q) zz = true;
      if (zeros + q < ones + qs - q) oo = true;
      if (zeros + q == ones + qs - q) {
        if (s[l - 1] == '0' || s[l - 1] == '?' && q >= 1) {
          oz = true;
        }
        if (s[l - 1] == '1' || s[l - 1] == '?' && qs - q >= 1) {
          zo = true;
        }
      }
    }
  }
  if (zz) cout << "00\n";
  if (zo) cout << "01\n";
  if (oz) cout << "10\n";
  if (oo) cout << "11\n";
  return 0;
}
