#include <bits/stdc++.h>
using namespace std;
char s[100100];
char s1[100100];
int res[5];
vector<int> zeros, ones;
int n;
int was[100100];
int model() {
  memset(was, 0, sizeof(was));
  for (int i = (0); i < (n); ++i)
    if (s[i] == '0')
      zeros.push_back(i);
    else
      ones.push_back(i);
  int p1 = 0;
  int p2 = 0;
  for (int i = (0); i < (n - 2); ++i) {
    if (i & 1)
      was[zeros[p2++]] = 1;
    else
      was[ones[p1++]] = 1;
  }
  int c = 0, p = 2;
  for (int i = (0); i < (n); ++i)
    if (was[i] == 0) {
      c += (s[i] - '0') * p;
      p /= 2;
    }
  return c;
}
int main() {
  scanf("%s", &s);
  n = strlen(s);
  int a = 0, b = 0, c = 0;
  for (int i = (0); i < (n); ++i) s1[i] = s[i];
  for (int i = (0); i < (n); ++i)
    if (s[i] == '0')
      a++;
    else if (s[i] == '1')
      b++;
    else
      c++;
  if (a + c > b) res[0] = 1;
  if (b + c > a + 1) res[3] = 1;
  if ((a + c + 1 >= b) && (b + c >= a)) {
    int v = n / 2;
    if (n & 1) v++;
    for (int i = (0); i < (n); ++i)
      if (s[i] == '1') v--;
    int cnt = 0;
    for (int i = (0); i < (n); ++i)
      if (s[i] == '?') {
        if (cnt < v) {
          s[i] = '1';
          cnt++;
        } else
          s[i] = '0';
      }
    int q = model();
    res[q] = 1;
    cnt = 0;
    for (int i = (0); i < (n); ++i) s[i] = s1[i];
    for (int i = n - 1; i >= 0; --i)
      if (s[i] == '?') {
        if (cnt < v) {
          s[i] = '1';
          cnt++;
        } else
          s[i] = '0';
      }
    zeros.clear();
    ones.clear();
    q = model();
    res[q] = 1;
  }
  for (int i = (0); i < (4); ++i)
    if (res[i]) {
      int v1 = (i & 1);
      int v2 = i / 2;
      cout << v2 << v1 << endl;
    }
  return 0;
}
