#include <bits/stdc++.h>
int n;
char s[1000100];
int count;
int n0, n1;
int main() {
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0; i < n; i++) {
    if (s[i] == '?') count++;
    if (s[i] == '0') n0++;
    if (s[i] == '1') n1++;
  }
  int mid1 = 0, mid0 = 0;
  int mid = 0;
  int chk1 = 0;
  int chk2 = 0;
  for (int i = 0; i <= count; i++) {
    int t0, t1;
    t0 = n0 + i;
    t1 = n1 + (count - i);
    if (t0 == t1 || t0 + 1 == t1) {
      mid = 1;
      if ((count - i) > 0) mid1 = 1;
      if (i > 0) mid0 = 1;
    } else {
      if (t0 > t1) {
        chk1 = 1;
      }
      if (t1 > t0) {
        chk2 = 1;
      }
    }
  }
  if (chk1) printf("00\n");
  if (mid == 1) {
    if (s[n - 1] != '?') {
      printf("%d%d\n", (s[n - 1] - '0') ^ 1, (s[n - 1] - '0'));
    } else {
      if (mid1 == 1) printf("01\n");
      if (mid0 == 1) printf("10\n");
    }
  }
  if (chk2) printf("11\n");
}
