#include <bits/stdc++.h>
using namespace std;
int nxt(const string &s, int now, char c) {
  int n = static_cast<int>(s.size());
  for (int i = now + 1; i < n; ++i) {
    if (s[i] == c) {
      return i;
    }
  }
  return n;
}
std::pair<int, int> check_result(const string &s) {
  int n = static_cast<int>(s.size());
  int first0 = nxt(s, -1, '0'), first1 = nxt(s, -1, '1'), alive = n;
  bool turn = true;
  while (alive != 2) {
    if (turn) {
      if (first1 == n)
        first0 = nxt(s, first0, '0');
      else
        first1 = nxt(s, first1, '1');
    } else {
      if (first0 == n)
        first1 = nxt(s, first1, '1');
      else
        first0 = nxt(s, first0, '0');
    }
    turn ^= 1;
    --alive;
  }
  std::string res;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '0' && i >= first0) res.push_back('0');
    if (s[i] == '1' && i >= first1) res.push_back('1');
  }
  return pair<int, int>(res[0] == '1', res[1] == '1');
}
string rep(const string &s, char c) {
  string res;
  res.reserve(s.size());
  for (char x : s) {
    if (x == '?')
      res.push_back(c);
    else
      res.push_back(x);
  }
  return res;
}
bool result[2][2];
pair<int, int> tsolve(const std::string &s) {
  auto res = check_result(s);
  result[res.first][res.second] = true;
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  getline(cin, s);
  int n = static_cast<int>(s.size());
  int qmarks = count(s.begin(), s.end(), '?');
  pair<int, int> z = tsolve(rep(s, '0'));
  pair<int, int> o = tsolve(rep(s, '1'));
  pair<int, int> lres = z;
  pair<int, int> rres = o;
  int l = 0;
  int r = n;
  while (r - l > 1) {
    int m = (l + r) / 2;
    pair<int, int> mres(
        tsolve(rep(s.substr(0, m), '1') + rep(s.substr(m, n - m), '0')));
    if (mres == lres)
      l = m;
    else if (mres == rres)
      r = m;
    else
      break;
  }
  l = 0;
  r = n;
  lres = o;
  rres = z;
  while (r - l > 1) {
    int m = (l + r) / 2;
    pair<int, int> mres(
        tsolve(rep(s.substr(0, m), '0') + rep(s.substr(m, n - m), '1')));
    if (mres == lres)
      l = m;
    else if (mres == rres)
      r = m;
    else
      break;
  }
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 2; ++j)
      if (result[i][j]) printf("%d%d\n", i, j);
  return 0;
}
