#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int i, zero = 0, one = 0, two = 0, three = 0, s1 = 0, s0 = 0, sq = 0;
  char last;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == '0')
      s0++;
    else if (s[i] == '1')
      s1++;
    else
      sq++;
    last = s[i];
  }
  if (s.size() % 2 == 0) {
    if (s0 + sq >= s1 + 2) zero = 1;
    if (s1 + sq >= s0 + 2) three = 1;
    if (s1 + sq >= s0 && s0 + sq >= s1) {
      two = 1;
      one = 1;
    }
    if (last == '?' && s1 + sq == s0) two = 0;
    if (last == '?' && s0 + sq == s1) one = 0;
  } else if (s.size() % 2 == 1) {
    if (s0 + sq >= s1 + 1) zero = 1;
    if (s1 + sq >= s0 + 3) three++;
    if (s0 + sq >= s1 - 1 && s1 + sq >= s0 + 1) {
      two = 1;
      one = 1;
    }
    if (last == '?' && s0 + sq == s1 - 1) one = 0;
    if (last == '?' && s1 + sq == s0 + 1) two = 0;
  }
  if (last == '1') two = 0;
  if (last == '0') one = 0;
  if (zero == 1) cout << "00" << endl;
  if (one == 1) cout << "01" << endl;
  if (two == 1) cout << "10" << endl;
  if (three == 1) cout << "11" << endl;
  return 0;
}
