#include <bits/stdc++.h>
using namespace std;
const int maxn = 110000;
char s[maxn];
int main() {
  int a = 0, b = 0, c = 0;
  gets(s);
  for (int i = 0; s[i]; i++)
    if (s[i] == '1')
      a++;
    else if (s[i] == '0')
      b++;
    else if (s[i] == '?')
      c++;
  int l = strlen(s);
  int ns = (l - 2) / 2 + (l - 2) % 2;
  int nt = (l - 2) / 2;
  if (l == 2) {
    for (int i = (s[0] == '?' ? 0 : s[0] - '0');
         i <= (s[0] == '?' ? 1 : s[0] - '0'); i++)
      for (int j = (s[1] == '?' ? 0 : s[1] - '0');
           j <= (s[1] == '?' ? 1 : s[1] - '0'); j++) {
        printf("%c%c\n", '0' + i, '0' + j);
      }
  } else if (a + c <= ns) {
    printf("00\n");
  } else if (b + c <= nt) {
    printf("11\n");
  } else {
    if (a <= ns) printf("00\n");
    int pd = 0;
    int fa;
    int fb;
    for (int i = 0; i <= c; i++) {
      if (a + i == ns + 1 && b + c - i == nt + 1) {
        fa = i;
        fb = c - i;
        pd = 1;
      }
    }
    if (pd) {
      if (s[l - 1] == '1' || (s[l - 1] == '?' && fa)) printf("01\n");
      if (s[l - 1] == '0' || (s[l - 1] == '?' && fb)) printf("10\n");
    }
    if (b <= nt) printf("11\n");
  }
  return 0;
}
