#include <bits/stdc++.h>
using namespace std;
int main() {
  string st;
  cin >> st;
  int n = st.size(), a = 0, b = 0, c = 0;
  for (int i = 0; i < n; i++) {
    if (st[i] == '?')
      ++c;
    else if (st[i] == '0')
      ++a;
    else
      ++b;
  }
  if (n % 2 == 0) {
    if (a + c - 2 >= b) cout << "00" << endl;
    if ((a + c >= b) && (b + c >= a)) {
      if ((a + c == b) && (st[n - 1] == '1')) cout << "01" << endl;
      if ((a + c > b) && (st[n - 1] != '0')) cout << "01" << endl;
      if ((b + c == a) && (st[n - 1] == '0')) cout << "10" << endl;
      if ((b + c > a) && (st[n - 1] != '1')) cout << "10" << endl;
    }
    if (b + c - 2 >= a) cout << "11" << endl;
  } else {
    if (a + c - 1 >= b) cout << "00" << endl;
    if ((a + c >= (b - 1)) && (b + c - 1 >= a)) {
      if ((a + c == (b - 1)) && (st[n - 1] == '1')) cout << "01" << endl;
      if ((a + c > (b - 1)) && (st[n - 1] != '0')) cout << "01" << endl;
      if ((b + c - 1 == a) && (st[n - 1] == '0')) cout << "10" << endl;
      if ((b + c - 1 > a) && (st[n - 1] != '1')) cout << "10" << endl;
    }
    if (b + c - 3 >= a) cout << "11" << endl;
  }
  return 0;
}
