#include <bits/stdc++.h>
const int maxn = 200003;
bool d[4];
bool mk[4];
char str[maxn];
int Abs(int x) { return x > 0 ? x : -x; }
void gao(int len, int a, int b, int c, int sta) {
  if (len & 1) {
    a--;
  }
  if (b + c > a) mk[0] = true;
  if (a + c > b) mk[3] = true;
  if (c >= Abs(a - b)) {
    if (sta & 1)
      mk[1] = true;
    else
      mk[2] = true;
  }
}
int main() {
  int i, j;
  int len, a, b, c;
  scanf("%s", str);
  len = strlen(str);
  a = b = c = 0;
  for (i = 0; i < len; i++) {
    if (str[i] == '1')
      a++;
    else if (str[i] == '0')
      b++;
    else
      c++;
  }
  char c1 = str[len - 1];
  char c2 = str[len - 2];
  int t1, t2;
  c = c - (c1 == '?') - (c2 == '?');
  for (i = 0; i < 2; i++) {
    if (c1 != '?' && c1 - '0' != i) continue;
    for (j = 0; j < 2; j++) {
      if (c2 != '?' && c2 - '0' != j) continue;
      t1 = (int)(c1 == '?' && i) + (c2 == '?' && j);
      t2 = (int)(c1 == '?' && !i) + (c2 == '?' && !j);
      int sta = i + 2 * j;
      gao(len, a + t1, b + t2, c, sta);
    }
  }
  for (i = 0; i < 4; i++)
    if (mk[i]) {
      printf("%d%d\n", i / 2, i % 2);
    }
  return 0;
}
