#include <bits/stdc++.h>
using namespace std;
char str[1000000];
int len;
bool yes(char s[3], int ls, int le) {
  while (true) {
  start:
    int mid = le - ls - 1, i;
    if (le != len - 1) {
      if (s[0] != s[1]) return 0;
    }
    int c[3] = {0}, sd[2];
    c[(s[1] - '0') ^ 1] += len - le - 1;
    for (i = ls + 1; i < le; i++) {
      if (str[i] == s[0]) return 0;
    }
    c[(s[0] - '0') ^ 1] += mid;
    for (i = 0; i < ls; i++) {
      if (str[i] == '?')
        c[2]++;
      else
        c[str[i] - '0']++;
    }
    if (len & 1)
      sd[0] = len / 2 - 1, sd[1] = sd[0] + 1;
    else
      sd[0] = len / 2 - 1, sd[1] = sd[0];
    if (s[0] != s[1]) {
      if (c[s[1] - '0'] > sd[s[1] - '0']) return 0;
      if (c[s[0] - '0'] > sd[s[0] - '0']) {
        if (str[ls] == '?') {
          for (i = ls - 1; i >= 0; i--) {
            if (str[i] == '?' || str[i] == s[0]) break;
          }
          if (i >= 0) {
            ls = i;
            goto start;
          }
        }
        return 0;
      }
    } else {
      if (s[0] == '0') {
        if (c[0] + c[2] < sd[0]) return 0;
      } else {
        if (c[1] + c[2] < sd[1]) return 0;
      }
    }
    return 1;
  }
}
bool ok(char s[3]) {
  int i, ls, le;
  for (le = len - 1; le >= 0; le--) {
    if (str[le] == s[1] || str[le] == '?') break;
  }
  if (le <= 0) return 0;
  for (ls = le - 1; ls >= 0; ls--) {
    if (str[ls] == s[0] || str[ls] == '?') break;
  }
  if (ls < 0) return 0;
  return yes(s, ls, le);
}
void run() {
  len = strlen(str);
  if (ok("00")) printf("00\n");
  if (ok("01")) printf("01\n");
  if (ok("10")) printf("10\n");
  if (ok("11")) printf("11\n");
}
int main() {
  scanf("%s", str);
  run();
  return 0;
}
