#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 * 200;
char s[maxn];
bool visit[maxn] = {false}, f[4] = {false};
int main() {
  int i, n, zero = 0, one = 0, other = 0;
  cin >> s;
  n = strlen(s);
  for ((i) = 0; (i) < (n); (i)++) {
    zero += (s[i] == '0');
    one += (s[i] == '1');
    other += (s[i] == '?');
  }
  if (one + other > zero + 1) f[3] = true;
  if (zero + other > one) f[0] = true;
  if (n & 1) {
    if (s[n - 1] == '?') {
      if (one + other - 1 >= zero && zero + other - 1 >= one) f[1] = true;
      if (one + other - 1 >= zero + 2 && zero + 2 + other - 1 >= one)
        f[2] = true;
    }
    if (s[n - 1] == '1') {
      if (one - 1 + other >= zero && one - 1 <= other + zero) f[1] = true;
    }
    if (s[n - 1] == '0') {
      if (one + other >= zero + 1 && zero + 1 + other >= one) f[2] = true;
    }
  } else {
    if (s[n - 1] == '?') {
      if (one + other >= zero && zero + other - 2 >= one) f[1] = true;
      if (one + other - 1 >= zero + 1 && zero + other >= one) f[2] = true;
    }
    if (s[n - 1] == '1') {
      if (one + other >= zero && one <= other + zero) f[1] = true;
    }
    if (s[n - 1] == '0') {
      if (one + other >= zero && one <= other + zero) f[2] = true;
    }
  }
  for ((i) = 0; (i) < (4); (i)++)
    if (f[i]) cout << i / 2 << i % 2 << endl;
  return 0;
}
