#include <bits/stdc++.h>
using namespace std;
int cnt1 = 0, cnt0 = 0, cntq = 0, l;
char s[100015];
int f[4];
int solve() {
  int i;
  for (i = l - 1; i >= 0; i--)
    if (s[i] == '0') break;
  int p1 = i;
  if (p1 < 0) return 3;
  for (i = l - 1; i >= 0; i--)
    if (s[i] == '1') break;
  int p2 = i;
  if (p2 < 0) return 0;
  if (p1 > p2) swap(p1, p2);
  return (s[p1] - '0') * 2 + (s[p2] - '0');
}
int main() {
  scanf("%s", s);
  l = strlen(s);
  int j = l - 1;
  for (; j >= 0; j--)
    if (s[j] == '?') break;
  int p1 = j;
  if (p1 < 0) p1 = 100005;
  j--;
  for (; j >= 0; j--)
    if (s[j] == '?') break;
  int p2 = j;
  if (p2 < 0) p2 = 100006;
  for (int j = 0; j < 4; j++) {
    cnt1 = 0;
    cnt0 = 0;
    cntq = 0;
    s[p1] = '0';
    s[p2] = '0';
    if (j & 2) s[p1]++;
    if (j & 1) s[p2]++;
    for (int i = 0; i < l; i++) {
      if (s[i] == '1') cnt1++;
      if (s[i] == '0') cnt0++;
      if (s[i] == '?') cntq++;
    }
    if (cnt1 + cntq - cnt0 >= 2) f[3] = 1;
    if (cnt1 - cntq - cnt0 <= -1) f[0] = 1;
    int d = cnt1 - cnt0;
    if (l & 1) {
      if (d < 0) {
        if (cnt1 + cntq - cnt0 >= 1) f[solve()] = 1;
      } else {
        if (cnt0 + cntq - cnt1 >= -1) f[solve()] = 1;
      }
    } else {
      if (d < 0) {
        if (cnt1 + cntq - cnt0 >= 0) f[solve()] = 1;
      } else {
        if (cnt0 + cntq - cnt1 >= 0) f[solve()] = 1;
      }
    }
  }
  if (f[0]) puts("00");
  if (f[1]) puts("01");
  if (f[2]) puts("10");
  if (f[3]) puts("11");
}
