#include <bits/stdc++.h>
int a[3], i;
char s[101010];
int main() {
  scanf("%s", s);
  for (i = 0; s[i]; i++) a[(s[i] != '0') + (s[i] == '?')]++;
  if (a[0] + a[2] > a[1]) puts("00");
  int half = i / 2, need0 = half, need1 = half + (i & 1), left = a[2];
  bool ok = 1;
  left -= (need0 - a[0] > 0 ? need0 - a[0] : 0);
  ok &= left >= 0;
  left -= (need1 - a[1] > 0 ? need1 - a[1] : 0);
  ok &= left >= 0;
  i--;
  if (ok && (s[i] == '1' || (s[i] == '?' && a[1] != need1))) puts("01");
  if (ok && (s[i] == '0' || (s[i] == '?' && a[0] != need0))) puts("10");
  if (a[1] + a[2] > a[0] + 1) puts("11");
  return 0;
}
