#include <bits/stdc++.h>
using namespace std;
int minzer = 0, minu = 0, maxzer = 0, maxu = 0;
string s;
inline bool equilibri() {
  return (maxzer >= int(s.size() / 2) && minzer <= int(s.size() / 2) &&
          maxu >= int(s.size() / 2) + s.size() % 2 &&
          minu <= int(s.size() / 2) + s.size() % 2);
}
int main() {
  while (cin >> s) {
    minzer = minu = maxzer = maxu = 0;
    int bcu = -1, wcu = -1, bcz = -1, wcz = -1;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0') {
        wcz = i;
        bcz = i;
        minzer++;
      }
      if (s[i] == '1') {
        wcu = i;
        bcu = i;
        minu++;
      }
      if (s[i] == '?') {
        bcu = bcz = i;
        maxzer++;
      }
    }
    maxu = maxzer + minu;
    maxzer += minzer;
    if (maxzer >= int((s.size() - 2) / 2) + 2) cout << "00" << endl;
    if (equilibri()) {
      if (wcu > bcz)
        cout << "01" << endl;
      else {
        if (int(s.size() / 2) + s.size() % 2 - minu > 0 && bcu > wcz)
          cout << "01" << endl;
      }
      if (wcz > bcu)
        cout << "10" << endl;
      else {
        if (int(s.size() / 2) - minzer > 0 && bcz > wcu) cout << "10" << endl;
      }
    }
    if (maxu >= min(s.size() - 2, int((s.size() - 2) / 2) + s.size() % 2) + 2)
      cout << "11" << endl;
  }
}
