#include <bits/stdc++.h>
using namespace std;
string str;
pair<int, int> p;
pair<int, int> b_or_w(bool flag) {
  int zr = 0, on = 0;
  for (int i = 0; i < str.size(); i++) {
    if (flag) {
      if (str[i] == '?' || str[i] == '1')
        on++;
      else
        zr++;
    } else {
      if (str[i] == '?' || str[i] == '0')
        zr++;
      else
        on++;
    }
  }
  return make_pair(zr, on);
}
set<string> ans;
int main() {
  int i, j, n;
  cin >> str;
  n = str.size();
  if (n == 2) {
    if (str[0] == '?') {
      string now = "";
      now += "1";
      now += str[1];
      ans.insert(now);
      now = "";
      now += "0";
      now += str[1];
      ans.insert(now);
    } else
      ans.insert(str);
    set<string> _ans;
    for (auto x : ans) {
      if (x[1] == '?') {
        string now = x;
        now[1] = '0';
        _ans.insert(now);
        now[1] = '1';
        _ans.insert(now);
      } else
        _ans.insert(x);
    }
    for (auto xx : _ans) cout << xx << endl;
    return 0;
  }
  p = b_or_w(true);
  if (p.first <= 1) {
    if (n % 2 == 0)
      ans.insert("11");
    else if (n == 3) {
      if (p.first == 0) ans.insert("11");
    } else
      ans.insert("11");
  } else if (p.second >= 2) {
    p.second -= 2;
    if (n % 2 == 0 && p.first <= p.second) ans.insert("11");
    if (n % 2 && p.first < p.second) ans.insert("11");
  }
  p = b_or_w(false);
  if (p.second <= 1)
    ans.insert("00");
  else if (p.first >= 2) {
    p.first -= 2;
    if (n % 2 == 0 && p.first >= p.second) ans.insert("00");
    if (n % 2 && p.second <= p.first + 1) ans.insert("00");
  }
  int zero = 0, one = 0, extra = 0;
  for (i = 0; i < n; i++) {
    if (str[i] == '0')
      zero++;
    else if (str[i] == '1')
      one++;
    else
      extra++;
  }
  if (n % 2 == 0) {
    if (zero > one + extra || one > zero + extra) {
    } else {
      if (str[n - 1] == '0') ans.insert("10");
      if (str[n - 1] == '?') {
        if (zero + 1 <= one + extra - 1) ans.insert("10");
      }
      if (str[n - 1] == '1') ans.insert("01");
      if (str[n - 1] == '?') {
        if (one + 1 <= zero + extra - 1) ans.insert("01");
      }
    }
  } else {
    int _o = one, _z = zero, _e = extra;
    while (extra) {
      if (one - zero < 1)
        one++;
      else
        zero++;
      extra--;
    }
    if (one - zero == 1) {
      if (str[n - 1] == '0') ans.insert("10");
      if (str[n - 1] == '?' && ((_o + _e - 1) - (_z + 1) >= 1))
        ans.insert("10");
      if (str[n - 1] == '1') ans.insert("01");
      if (str[n - 1] == '?' && (_o + 1) - (_z + _e - 1) <= 1) ans.insert("01");
    }
  }
  for (auto xx : ans) cout << xx << endl;
}
