#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const int inf = 0x3f3f3f3f;
char str[100005];
bool ok[4];
char ans[4][3] = {"00", "01", "10", "11"};
bool _01(int a, int b, int c) {
  int n = a + b + c;
  int x = b + c - a + (n & 1);
  x >>= 1;
  return x >= 0 && x <= c;
}
bool _10(int a, int b, int c) {
  int n = a + b + c;
  int x = b + c - a + (n & 1);
  x >>= 1;
  return x >= 0 && x <= c;
}
int main() {
  scanf("%s", str);
  int a = 0, b = 0, len = 0, c = 0;
  for (len = 0; str[len]; ++len) {
    if (str[len] == '1')
      ++a;
    else if (str[len] == '0')
      ++b;
    else
      ++c;
  }
  if (a < b + c) ok[0] = 1;
  int l = str[len - 1] == '?';
  if (str[len - 1] != '0' && _01(a + l, b, c - l)) ok[1] = 1;
  if (str[len - 1] != '1' && _10(a, b + l, c - l)) ok[2] = 1;
  if (b < a + c - 1) ok[3] = 1;
  for (int i = (0), __ = (4); i < __; ++i)
    if (ok[i]) printf("%s\n", ans[i]);
  return 0;
}
