#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  char s[200000];
  while (gets(s)) {
    int i, x;
    a = b = c = 0;
    for (i = 0; s[i]; i++) {
      if (s[i] == '0')
        b++;
      else if (s[i] == '1')
        a++;
      else
        c++;
    }
    if (c == 0) {
      if (a < b) puts("00");
      if (a == b || a == b + 1) {
        if (s[i - 1] == '1')
          puts("01");
        else
          puts("10");
      }
      if (a > b + 1) puts("11");
    } else {
      if (a < b + c) puts("00");
      x = (b + c - a + (a + b + c) % 2) / 2;
      if (x >= 0 && x <= c) {
        if (x == 0 && s[i - 1] == '?') s[i - 1] = '0';
        if (x == c && s[i - 1] == '?') s[i - 1] = '1';
        if (s[i - 1] == '1')
          puts("01");
        else if (s[i - 1] == '0')
          puts("10");
        else {
          puts("01");
          puts("10");
        }
      }
      if (a + c > b + 1) puts("11");
    }
  }
  return 0;
}
