#include <bits/stdc++.h>
int simulate(char* T, int n) {
  int z = n / 2 - 1;
  int o = (n + 1) / 2 - 1;
  for (int i = 0; i < n; i++) {
    if (T[i] == '1' && o-- > 0) T[i] = '?';
    if (T[i] == '0' && z-- > 0) T[i] = '?';
  }
  int r = 0;
  for (int i = 0; i < n; i++)
    if (T[i] != '?') {
      r = 2 * r + T[i] - '0';
      if (r > 3) r = 3;
    }
  return r;
}
int main() {
  char S[100100], T[100100];
  int res[4];
  scanf("%s", &S);
  int n = strlen(S);
  int zero = 0;
  int one = 0;
  int q = 0;
  for (int r = 0; r < 4; r++) res[r] = 0;
  for (int i = 0; i < n; i++) {
    if (S[i] == '0') zero++;
    if (S[i] == '1') one++;
    if (S[i] == '?') q++;
  }
  for (int i = 0; i < n; i++) T[i] = (S[i] == '?' ? '1' : S[i]);
  res[simulate(T, n)] = 1;
  for (int i = 0; i < n; i++) T[i] = (S[i] == '?' ? '0' : S[i]);
  res[simulate(T, n)] = 1;
  int nz = zero;
  int no = one;
  for (int i = 0; i < q; i++)
    if (no <= nz)
      no++;
    else
      nz++;
  int kz = nz - zero;
  int ko = no - one;
  for (int i = 0; i < n; i++) {
    if (S[i] == '?') {
      if (kz-- > 0)
        T[i] = '0';
      else
        T[i] = '1';
    } else
      T[i] = S[i];
  }
  res[simulate(T, n)] = 1;
  kz = nz - zero;
  ko = no - one;
  for (int i = 0; i < n; i++) {
    if (S[i] == '?') {
      if (ko-- > 0)
        T[i] = '1';
      else
        T[i] = '0';
    } else
      T[i] = S[i];
  }
  res[simulate(T, n)] = 1;
  for (int r = 0; r < 4; r++)
    if (res[r]) printf("%d%d\n", r / 2, r % 2);
}
