#include <bits/stdc++.h>
using namespace std;
int flag[4], x, y, z, len;
char s[100005];
bool check01() {
  if (s[len - 1] == '0') return 0;
  x = 1, y = 0, z = 0;
  for (int i = 0; i < len - 1; i++) {
    if (s[i] == '1') x++;
    if (s[i] == '0') y++;
    if (s[i] == '?') z++;
  }
  if (x - (z + y) >= 2 || y - (x + z) >= 1) return 0;
  return 1;
}
bool check10() {
  if (s[len - 1] == '1') return 0;
  x = 0, y = 1, z = 0;
  for (int i = 0; i < len - 1; i++) {
    if (s[i] == '1') x++;
    if (s[i] == '0') y++;
    if (s[i] == '?') z++;
  }
  if (x - (z + y) >= 2 || y - (x + z) >= 1) return 0;
  return 1;
}
int main() {
  scanf("%s", s);
  len = strlen(s);
  for (int i = 0; i < len; i++) {
    if (s[i] == '1') x++;
    if (s[i] == '0') y++;
    if (s[i] == '?') z++;
  }
  if (x + z - y >= 2) flag[0] = 1;
  if (y + z - x >= 1) flag[1] = 1;
  if (check01()) flag[2] = 1;
  if (check10()) flag[3] = 1;
  if (flag[1]) printf("00\n");
  if (flag[2]) printf("01\n");
  if (flag[3]) printf("10\n");
  if (flag[0]) printf("11\n");
  return 0;
}
