#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
long long powmod(long long a, long long b) {
  long long res = 1;
  if (a >= mod) a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a;
    if (res >= mod) res %= mod;
    a = a * a;
    if (a >= mod) a %= mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
string s;
int main() {
  ios_base::sync_with_stdio(false);
  ;
  cin.tie(0);
  cout.tie(0);
  int i, n, o, z, q, j;
  o = z = q = 0;
  cin >> s;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == '1')
      o++;
    else if (s[i] == '0')
      z++;
    else
      q++;
  }
  set<string> ans;
  n = s.length();
  int fir = (n - 2 + 1) / 2, sec = (n - 2) / 2;
  if (fir >= o) ans.insert("00");
  if (sec >= z) ans.insert("11");
  if (o <= fir + 1 && z <= sec + 1) {
    if (s[n - 1] == '1' || (s[n - 1] == '?' && o <= fir)) ans.insert("01");
    if ((s[n - 1] == '0' || (s[n - 1] == '?' && z <= sec))) ans.insert("10");
  }
  for (auto v : ans) cout << v << '\n';
  return 0;
}
