#include <bits/stdc++.h>
using namespace std;
char s[1000001];
int n;
int a[1000001];
int b[1000001];
int k[3];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  for (int i = 0; i < n; ++i) {
    a[i] = (s[i] == '0') ? 0 : s[i] == '1' ? 1 : 2;
    ++k[a[i]];
  }
  int s = k[0] + k[1] + k[2];
  int s0 = s >> 1;
  int s1 = (s + 1) >> 1;
  if (s0 < k[0]) {
    printf("00\n");
    return 0;
  }
  if (s1 < k[1]) {
    printf("11\n");
    return 0;
  }
  int k0 = s0 - k[0];
  int k1 = s1 - k[1];
  for (int i = 0, j = 0; i < n; ++i) {
    if (a[i] != 2) {
      b[i] = a[i];
      continue;
    }
    if (j++ < k0)
      b[i] = 0;
    else
      b[i] = 1;
  }
  bool ok1 = 0;
  bool ok2 = 0;
  if (b[n - 1] == 1)
    ok1 = 1;
  else
    ok2 = 1;
  for (int i = 0, j = 0; i < n; ++i) {
    if (a[i] != 2) {
      b[i] = a[i];
      continue;
    }
    if (j++ < k1)
      b[i] = 1;
    else
      b[i] = 0;
  }
  if (b[n - 1] == 1)
    ok1 = 1;
  else
    ok2 = 1;
  if (k[0] + k[2] > k[1]) printf("00\n");
  if (ok1) printf("01\n");
  if (ok2) printf("10\n");
  if (k[1] + k[2] > k[0] + 1) printf("11\n");
  return 0;
}
