#include <bits/stdc++.h>
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e6 + 5;
const double eps = 1e-9;
using namespace std;
char str[MAXN];
int c[3];
int main() {
  scanf("%s", str);
  int n = strlen(str);
  for (int i = 0; i < n; i++)
    if (str[i] == '0')
      c[0]++;
    else if (str[i] == '1')
      c[1]++;
    else
      c[2]++;
  if (c[0] + c[2] > c[1]) printf("00\n");
  int d = c[1] - c[0];
  if ((d > 0 && c[2] > d - 2) || (d < 0 && c[2] >= -d) || d == 0) {
    if (str[n - 1] == '1')
      printf("01\n");
    else if (str[n - 1] == '?') {
      if (!(d > 0 && (d - 1 == c[2] || d == c[2]))) printf("01\n");
      if (!((d < 0 && (-d + 1 == c[2] || -d == c[2])) || (d == 0 && c[2] == 1)))
        printf("10\n");
    } else
      printf("10\n");
  }
  if (c[1] - 2 + c[2] >= c[0]) printf("11\n");
  return 0;
}
