#include <bits/stdc++.h>
using namespace std;
int main() {
  set<string> res;
  string s;
  cin >> s;
  int n = s.size();
  int one = count(s.begin(), s.end(), '1');
  int zero = count(s.begin(), s.end(), '0');
  int que = count(s.begin(), s.end(), '?');
  int m = n / 2 + n % 2;
  if (one + que > m) res.insert("11");
  if (one < m) res.insert("00");
  int h = m - one;
  if (0 <= h && h <= que)
    if (*s.rbegin() == '1')
      res.insert("01");
    else if (*s.rbegin() == '0')
      res.insert("10");
    else {
      if (0 <= h - 1 && h - 1 <= que - 1) res.insert("01");
      if (0 <= h && h <= que - 1) res.insert("10");
    }
  for (set<string>::iterator it = res.begin(); it != res.end(); it++)
    cout << *it << endl;
  return 0;
}
