#include <bits/stdc++.h>
using namespace std;
set<int> zero, one;
int n;
char org[(200000)], g[(200000)];
bool ans[10];
int check() {
  zero.clear(), one.clear();
  for (int i = 0; i < n; ++i)
    if (g[i] == '0')
      zero.insert(i);
    else
      one.insert(i);
  for (int i = 0; i < n - 2; ++i) {
    if (i & 1) {
      if (zero.size())
        zero.erase(zero.begin());
      else
        one.erase(one.begin());
    } else {
      if (((int)one.size()) == 0)
        zero.erase(zero.begin());
      else
        one.erase(one.begin());
    }
  }
  if (((int)one.size()) == 0) return 0;
  if (((int)zero.size()) == 0) return 3;
  if (*one.begin() < *zero.begin()) return 2;
  return 1;
}
int main() {
  scanf("%s", org);
  for (n = 0; org[n]; ++n)
    ;
  int s0, s1, mid0, mid1, sa, sb;
  s0 = s1 = mid0 = mid1 = sa = sb = 0;
  for (int i = 0; i < n; ++i) {
    if (org[i] == '0') s0++;
    if (org[i] == '1') s1++;
  }
  sa = (n + 1) / 2, sb = n / 2;
  mid0 = sb - s0, mid1 = sa - s1;
  memcpy(g, org, sizeof(g));
  for (int i = 0; i < n; ++i)
    if (g[i] == '?') g[i] = '0';
  ans[check()] = true;
  memcpy(g, org, sizeof(g));
  for (int i = 0, cnt = 0; i < n; ++i)
    if (g[i] == '?') {
      if (cnt++ >= mid0)
        g[i] = '1';
      else
        g[i] = '0';
    }
  ans[check()] = true;
  memcpy(g, org, sizeof(g));
  for (int i = 0, cnt = 0; i < n; ++i)
    if (g[i] == '?') {
      if (cnt++ >= mid1)
        g[i] = '0';
      else
        g[i] = '1';
    }
  ans[check()] = true;
  memcpy(g, org, sizeof(g));
  for (int i = 0; i < n; ++i)
    if (g[i] == '?') g[i] = '1';
  ans[check()] = true;
  if (ans[0]) puts("00");
  if (ans[1]) puts("01");
  if (ans[2]) puts("10");
  if (ans[3]) puts("11");
  return 0;
}
