#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int cont1 = 0;
  int cont0 = 0;
  int cont = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '1')
      cont1++;
    else if (s[i] == '0')
      cont0++;
    else
      cont++;
  }
  if (cont1 < cont0 + cont) cout << "00" << endl;
  if (s[s.size() - 1] == '?') {
    int aux1 = cont1;
    int aux0 = cont0;
    int aux = cont;
    aux--;
    aux1++;
    int q1;
    int q0;
    if (s.size() % 2 == 0) {
      q1 = s.size() / 2;
      q0 = s.size() / 2;
    } else {
      q1 = s.size() / 2 + 1;
      q0 = s.size() / 2;
    }
    if (q1 >= aux1 and q0 >= aux0 and (q1 - aux1) + (q0 - aux0) == aux)
      cout << "01" << endl;
    aux1 = cont1;
    aux0 = cont0;
    aux = cont;
    aux--;
    aux0++;
    if (q1 >= aux1 and q0 >= aux0 and (q1 - aux1) + (q0 - aux0) == aux)
      cout << "10" << endl;
  } else {
    int aux1 = cont1;
    int aux0 = cont0;
    int aux = cont;
    int q1;
    int q0;
    if (s.size() % 2 == 0) {
      q1 = s.size() / 2;
      q0 = s.size() / 2;
    } else {
      q1 = s.size() / 2 + 1;
      q0 = s.size() / 2;
    }
    if (q1 >= aux1 and q0 >= aux0 and (q1 - aux1) + (q0 - aux0) == aux and
        s[s.size() - 1] == '1')
      cout << "01" << endl;
    if (q1 >= aux1 and q0 >= aux0 and (q1 - aux1) + (q0 - aux0) == aux and
        s[s.size() - 1] == '0')
      cout << "10" << endl;
  }
  if (cont0 + 1 < cont1 + cont) cout << "11" << endl;
}
