#include <bits/stdc++.h>
using namespace std;
int c[5] = {0}, sn;
char s[110000];
int main() {
  setbuf(stdout, NULL);
  int i, j, ii, jj;
  scanf("%s", s);
  sn = strlen(s);
  for (i = 0; i < sn; i++) {
    if (s[i] == '0')
      c[0]++;
    else if (s[i] == '1')
      c[1]++;
    else
      c[2]++;
  }
  if (c[0] + c[2] > c[1]) {
    printf("00\n");
  }
  if (sn & 1) {
    int one = sn / 2 + 1;
    int zo = sn / 2;
    if (c[1] <= one && one - c[1] <= c[2]) {
      int toone = one - c[1];
      string s1 = string(s);
      for (i = sn - 1; i >= 0 && toone; i--) {
        if (s1[i] == '?') {
          s1[i] = '1';
          toone--;
        }
      }
      for (i = sn - 1; i >= 0; i--) {
        if (s1[i] == '?' || s1[i] == '0') break;
      }
      for (j = i + 1; j < sn; j++)
        if (s1[j] == '1') {
          printf("01\n");
          break;
        }
      int tozo = zo - c[0];
      s1 = string(s);
      for (i = sn - 1; i >= 0 && tozo; i--) {
        if (s1[i] == '?') {
          s1[i] = '0';
          tozo--;
        }
      }
      for (i = sn - 1; i >= 0; i--) {
        if (s1[i] == '?' || s1[i] == '1') break;
      }
      for (j = i + 1; j < sn; j++)
        if (s1[j] == '0') {
          printf("10\n");
          break;
        }
    }
  } else {
    int one = sn / 2;
    int zo = sn / 2;
    if (c[1] <= one && one - c[1] <= c[2]) {
      int toone = one - c[1];
      string s1 = string(s);
      for (i = sn - 1; i >= 0 && toone; i--) {
        if (s1[i] == '?') {
          s1[i] = '1';
          toone--;
        }
      }
      for (i = sn - 1; i >= 0; i--) {
        if (s1[i] == '?' || s1[i] == '0') break;
      }
      for (j = i + 1; j < sn; j++)
        if (s1[j] == '1') {
          printf("01\n");
          break;
        }
      int tozo = zo - c[0];
      s1 = string(s);
      for (i = sn - 1; i >= 0 && tozo; i--) {
        if (s1[i] == '?') {
          s1[i] = '0';
          tozo--;
        }
      }
      for (i = sn - 1; i >= 0; i--) {
        if (s1[i] == '?' || s1[i] == '1') break;
      }
      for (j = i + 1; j < sn; j++)
        if (s1[j] == '0') {
          printf("10\n");
          break;
        }
    }
  }
  if (c[1] + c[2] > c[0] + 1) {
    printf("11\n");
  }
  return 0;
}
