#include <bits/stdc++.h>
using namespace std;
char s[100005];
bool ret[10];
int N, M, P;
void solve(int z, int o, int j, int i) {
  if (o >= M + 2) ret[3] = 1;
  if (z >= P + 2) ret[0] = 1;
  if (o == M + 1) {
    if (!i)
      ret[2] = 1;
    else
      ret[1] = 1;
  }
}
int main() {
  int ones, zeros, q;
  scanf("%s", s);
  N = strlen(s);
  M = N / 2 + N % 2 - 1;
  P = N / 2 - 1;
  ones = 0;
  zeros = 0;
  q = 0;
  for (int i = 0; i < N - 2; i++) {
    if (s[i] == '1') ones++;
    if (s[i] == '0') zeros++;
    if (s[i] == '?') q++;
  }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      if ((s[N - 1] - '0' == i || s[N - 1] == '?') &&
          (s[N - 2] - '0' == j || s[N - 2] == '?')) {
        int o = 0, z = 0;
        if (i) o++;
        if (j) o++;
        if (!i) z++;
        if (!j) z++;
        for (int k = 0; k <= q; k++)
          solve(zeros + z + k, ones + o + q - k, j, i);
      }
    }
  }
  if (ret[0]) printf("00\n");
  if (ret[1]) printf("01\n");
  if (ret[2]) printf("10\n");
  if (ret[3]) printf("11\n");
}
