#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
const double PI = acos(-1.0);
int main() {
  string s, prev;
  cin >> s;
  int len = ((int)s.size());
  int max1 = 0, max0 = 0, min0 = 0;
  for (int i = 0; i < (int)(len); ++i) {
    if (s[i] == '0')
      ++max0;
    else if (s[i] == '1')
      ++max1;
    else
      ++max0, ++max1;
  }
  min0 = len - max1;
  if (max0 >= len - max0 + 1) puts("00");
  prev = s;
  if (s[len - 1] != '0') {
    s[len - 1] = '1';
    int max0_ = 0, min0_ = 0;
    for (int i = 0; i < (int)(len); ++i) {
      if (s[i] == '0')
        ++max0_, ++min0_;
      else if (s[i] == '?')
        ++max0_;
    }
    if (min0_ <= len / 2 && len / 2 <= max0_) puts("01");
    s = prev;
  }
  if (s[len - 1] != '1') {
    s[len - 1] = '0';
    int max0_ = 0, min0_ = 0;
    for (int i = 0; i < (int)(len); ++i) {
      if (s[i] == '0')
        ++max0_, ++min0_;
      else if (s[i] == '?')
        ++max0_;
    }
    if (min0_ <= len / 2 && len / 2 <= max0_) puts("10");
    s = prev;
  }
  if (max1 >= len - max1 + 2) puts("11");
  return 0;
}
