#include <bits/stdc++.h>
using namespace std;
int cmpint(const void *a, const void *b) {
  if (((int *)a)[0] == ((int *)b)[0]) return ((int *)a)[1] - ((int *)b)[1];
  return ((int *)a)[0] - ((int *)b)[0];
}
char s[100005];
int a[4] = {0};
int abs(int a) {
  if (a > 0) return a;
  return -a;
}
int main() {
  int i, j, n, m, k, l, o, p;
  n = m = k = 0;
  gets(s);
  l = strlen(s);
  for (i = (0); i < (l); i++)
    if (s[i] == '0')
      m++;
    else if (s[i] == '1')
      n++;
    else
      k++;
  if (m + k - n >= 1) a[0] = 1;
  if (n + k - m >= 2) a[3] = 1;
  if (l % 2 == 0) {
    if (abs(n - m) <= k) {
      if (abs(n - m) == k && s[l - 1] == '?') {
        if (n < m)
          s[l - 1] = '1';
        else
          s[l - 1] = '0';
      }
      if (s[l - 1] == '0')
        a[2] = 1;
      else if (s[l - 1] == '1')
        a[1] = 1;
      else {
        a[1] = a[2] = 1;
      }
    }
  } else {
    if (n == 0)
      k--;
    else
      n -= 1;
    if (abs(n - m) <= k) {
      if (abs(n - m) == k && s[l - 1] == '?') {
        if (n < m)
          s[l - 1] = '1';
        else
          s[l - 1] = '0';
      }
      if (s[l - 1] == '0')
        a[2] = 1;
      else if (s[l - 1] == '1')
        a[1] = 1;
      else {
        a[1] = a[2] = 1;
      }
    }
  }
  for (i = (0); i < (4); i++)
    if (a[i] == 1) {
      printf("%d%d\n", i / 2, i % 2);
    }
  return 0;
}
