#include <bits/stdc++.h>
using namespace std;
string s;
int a, b, c;
int main() {
  cin >> s;
  int l = s.length();
  for (int i = 0; i < l; i++) {
    switch (s[i]) {
      case '0':
        b++;
        break;
      case '1':
        a++;
        break;
      case '?':
        c++;
        break;
    }
  }
  if (a < b + c) cout << "00" << endl;
  if (s[l - 1] != '0') {
    int a2 = a;
    int c2 = c;
    if (s[l - 1] == '?') {
      c2--;
      a2++;
    }
    int x = (b + c2 - a2 + (a + b + c) % 2) / 2;
    if (x >= 0 && x <= c2) cout << "01" << endl;
  }
  if (s[l - 1] != '1') {
    int b2 = b;
    int c2 = c;
    if (s[l - 1] == '?') {
      c2--;
      b2++;
    }
    int x = (b2 + c2 - a + (a + b + c) % 2) / 2;
    if (x >= 0 && x <= c2) cout << "10" << endl;
  }
  if (a + c > b + 1) cout << "11" << endl;
  return 0;
}
