#include <bits/stdc++.h>
using namespace std;
char C[100005];
int a, b, c;
bool F[5];
int M(int o, int z, int x) {
  if (o >= z + 2) return 3;
  if (z >= o + 1) return 0;
  return x;
}
int main() {
  cin >> C;
  char l = '0';
  for (int i = 0; C[i]; i++) {
    if (C[i] == '0') a++;
    if (C[i] == '1') b++;
    if (C[i] == '?') c++;
    l = C[i];
  }
  int x;
  for (int i = 0; i <= c; i++) {
    if (l == '0') x = 2;
    if (l == '1') x = 1;
    if (l == '?') {
      x = 0;
      if (i) x += 1;
      if (i != c) x += 2;
    }
    if (x == 3) x++;
    F[M(b + i, a + c - i, x)] = 1;
  }
  if (F[0]) printf("00\n");
  if (F[1] || F[4]) printf("01\n");
  if (F[2] || F[4]) printf("10\n");
  if (F[3]) printf("11\n");
  return 0;
}
