#include <bits/stdc++.h>
using namespace std;
int wcnt[300];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    wcnt[s[i]]++;
  }
  if (wcnt['0'] + wcnt['?'] >= wcnt['1'] + 1) {
    cout << "00" << '\n';
  }
  if (s.back() == '1' || s.back() == '?') {
    int one = wcnt['1'], ques = wcnt['?'], zero = wcnt['0'];
    if (s.back() == '?') {
      one += 1;
      ques -= 1;
    }
    if (one > zero) {
      if (one - 1 - zero <= ques) {
        cout << "01"
             << "\n";
      }
    } else {
      if (zero - one <= ques) {
        cout << "01"
             << "\n";
      }
    }
  }
  if (s.back() == '0' || s.back() == '?') {
    int one = wcnt['1'], ques = wcnt['?'], zero = wcnt['0'];
    if (s.back() == '?') {
      zero += 1;
      ques -= 1;
    }
    if (one > zero) {
      if (one - 1 - zero <= ques) {
        cout << "10"
             << "\n";
      }
    } else {
      if (zero - one <= ques) {
        cout << "10"
             << "\n";
      }
    }
  }
  if (wcnt['1'] + wcnt['?'] >= wcnt['0'] + 2) {
    cout << "11" << '\n';
  }
  return 0;
}
