#include <bits/stdc++.h>
using namespace std;
char s[100500];
char ss[100500];
int main() {
  bool res[4];
  int i, l, tmp, t;
  int kol0 = 0, kol1 = 0, kolq = 0;
  scanf("%s", s);
  l = strlen(s);
  for (i = 0; i < l; i++) {
    if (s[i] == '0') kol0++;
    if (s[i] == '1') kol1++;
    if (s[i] == '?') kolq++;
  }
  memset(res, false, sizeof(res));
  int last0, last1;
  if (l & 1) {
    if (kol0 + kolq > kol1) res[0] = true;
    if (kol1 + kolq > kol0 + 1) res[3] = true;
    if (kol1 + kolq > l / 2 && kol0 + kolq >= l / 2) {
      tmp = l / 2 + 1 - kol1;
      for (i = 0, t = 0; i < l; i++) {
        if (s[i] == '?') {
          if (t < tmp) {
            t++;
            last1 = i;
          } else
            last0 = i;
        } else if (s[i] == '0')
          last0 = i;
        else
          last1 = i;
      }
      if (last1 < last0) res[2] = true;
      tmp = l / 2 - kol0;
      for (i = 0, t = 0; i < l; i++) {
        if (s[i] == '?') {
          if (t < tmp) {
            t++;
            last0 = i;
          } else
            last1 = i;
        } else if (s[i] == '0')
          last0 = i;
        else
          last1 = i;
      }
      if (last0 < last1) res[1] = true;
    }
  } else {
    if (kol1 + kolq > kol0 + 1) res[3] = true;
    if (kol0 + kolq > kol1 + 1) res[0] = true;
    if (kol1 + kolq >= l / 2 && kol0 + kolq >= l / 2) {
      tmp = l / 2 - kol1;
      for (i = 0, t = 0; i < l; i++) {
        if (s[i] == '?') {
          if (t < tmp) {
            t++;
            last1 = i;
          } else
            last0 = i;
        } else if (s[i] == '0')
          last0 = i;
        else
          last1 = i;
      }
      if (last1 < last0) res[2] = true;
      tmp = l / 2 - kol0;
      for (i = 0, t = 0; i < l; i++) {
        if (s[i] == '?') {
          if (t < tmp) {
            t++;
            last0 = i;
          } else
            last1 = i;
        } else if (s[i] == '0')
          last0 = i;
        else
          last1 = i;
      }
      if (last0 < last1) res[1] = true;
    }
  }
  if (res[0]) printf("00\n");
  if (res[1]) printf("01\n");
  if (res[2]) printf("10\n");
  if (res[3]) printf("11\n");
  return 0;
}
