#include <bits/stdc++.h>
using namespace std;
char a[1000100];
int n, c0, c1, cnt;
void init() {
  n = 0;
  while (1) {
    scanf("%c", &a[++n]);
    if ((a[n] == 48) || (a[n] == 49) || (a[n] == '?'))
      ;
    else {
      n--;
      break;
    }
  }
  cnt = 0;
  c0 = 0;
  c1 = 0;
  for (int i = 1; i <= n; i++) {
    cnt += (a[i] == '?');
    c0 += (a[i] == '0');
    c1 += (a[i] == '1');
  }
}
int main() {
  init();
  if (c0 + cnt > c1) printf("00\n");
  bool cas1 = 0, cas2 = 0;
  for (int i = 0; i <= cnt; i++) {
    if (c0 + i == c1 + cnt - i) {
      if ((a[n] == '1') || (a[n] == '?' && (i < cnt))) cas1 = 1;
      ;
      if ((a[n] == '0') || (a[n] == '?' && (i > 0))) cas2 = 1;
    }
    if (c1 + i == c0 + 1 + cnt - i) {
      if ((a[n] == '1') || ((a[n] == '?') && i > 0)) cas1 = 1;
      if ((a[n] == '0') || ((a[n] == '?') && i < cnt)) cas2 = 1;
    }
  }
  if (cas1) printf("01\n");
  if (cas2) printf("10\n");
  if (c1 + cnt > c0 + 1) printf("11\n");
  return 0;
}
