#include <bits/stdc++.h>
using namespace std;
char str[100100];
int main() {
  scanf("%s", str);
  int n0 = 0, n1 = 0, ni = 0, size = strlen(str), pos1, pos0;
  bool p1, p0;
  for (int i = (0); i < (size); i++) {
    if (str[i] == '0')
      n0++;
    else if (str[i] == '1')
      n1++;
    else
      ni++;
  }
  if (n1 < n0 + ni) printf("00\n");
  if (!(n0 <= size / 2 && n0 + ni >= size / 2)) goto lol;
  if (n0 == size / 2) {
    p1 = true;
    p0 = false;
  } else if (n0 + ni == size / 2) {
    p1 = false;
    p0 = true;
  } else {
    p1 = true;
    p0 = true;
  }
  for (int i = size - 1; i >= 0; i--) {
    if (str[i] == '1' || (str[i] == '?' && p1)) {
      pos1 = i;
      break;
    }
  }
  for (int i = size - 1; i >= 0; i--) {
    if (str[i] == '0' || (str[i] == '?' && p0 && i != pos1)) {
      pos0 = i;
      break;
    }
  }
  if (pos0 < pos1) printf("01\n");
  for (int i = size - 1; i >= 0; i--) {
    if (str[i] == '0' || (str[i] == '?' && p0)) {
      pos0 = i;
      break;
    }
  }
  for (int i = size - 1; i >= 0; i--) {
    if (str[i] == '1' || (str[i] == '?' && p1 && i != pos0)) {
      pos1 = i;
      break;
    }
  }
  if (pos1 < pos0) printf("10\n");
lol:;
  if (n1 + ni > n0 + 1) printf("11\n");
  return 0;
}
