#include <bits/stdc++.h>
using namespace std;
int main() {
  char str[100009];
  char table[4][3] = {
      {'0', '0', '\0'}, {'0', '1', '\0'}, {'1', '0', '\0'}, {'1', '1', '\0'}};
  bool flag[4] = {0};
  scanf("%s", str);
  int l = strlen(str), step0, step1;
  int zero = 0, one = 0, mark = 0;
  if (l % 2) {
    step0 = max(0, (l - 3) / 2);
    step1 = max(0, (l - 1) / 2);
  } else
    step0 = step1 = (l - 2) / 2;
  for (int i = 0; i < l; i++) {
    if (str[i] == '0') zero++;
    if (str[i] == '1') one++;
    if (str[i] == '?') mark++;
  }
  if (zero + mark > step0 && one <= step1) flag[0] = true;
  if (one + mark > step1 && zero <= step0) flag[3] = true;
  if (zero <= step0 + 1 && one <= step1 + 1) {
    if (zero == step0 + 1 && str[l - 1] == '0') flag[2] = true;
    if (zero < step0 + 1 && str[l - 1] != '1') flag[2] = true;
    if (one == step1 + 1 && str[l - 1] == '1') flag[1] = true;
    if (one < step1 + 1 && str[l - 1] != '0') flag[1] = true;
  }
  for (int i = 0; i <= 3; i++)
    if (flag[i]) printf("%s\n", table[i]);
  return 0;
}
