#include <bits/stdc++.h>
const int maxN = 100000 + 2;
char str[maxN];
int main() {
  scanf("%s", str);
  int L = strlen(str);
  int t0 = 0, t1 = 0, t_ = 0;
  for (int i = 0; i < L; ++i) {
    if (str[i] == '0')
      ++t0;
    else if (str[i] == '1')
      ++t1;
    else
      ++t_;
  }
  int v[4];
  memset(v, 0, sizeof(v));
  if ((t1 + 0) < (t0 + t_)) v[0] = 1;
  if ((t1 + t_) > (t0 + 1)) v[3] = 1;
  int half = L / 2;
  if (L % 2 == 0) {
    if (t1 < half && t0 < half) {
      if (str[L - 1] == '1')
        v[1] = 1;
      else if (str[L - 1] == '0')
        v[2] = 1;
      else
        v[1] = v[2] = 1;
    } else if (t1 == half && t0 == half) {
      if (str[L - 1] == '1')
        v[1] = 1;
      else
        v[2] = 1;
    } else if (t1 == half) {
      if (str[L - 1] == '1')
        v[1] = 1;
      else
        v[2] = 1;
    } else if (t0 == half) {
      if (str[L - 1] == '0')
        v[2] = 1;
      else
        v[1] = 1;
    }
  } else {
    if ((t1 < half + 1) && (t1 + t_ >= half + 1)) {
      if (str[L - 1] == '1')
        v[1] = 1;
      else if (str[L - 1] == '0')
        v[2] = 1;
      else {
        if (t1 + t_ > half + 1)
          v[1] = v[2] = 1;
        else
          v[1] = 1;
      }
    } else if (t1 == half + 1) {
      if (str[L - 1] == '1')
        v[1] = 1;
      else
        v[2] = 1;
    }
  }
  if (v[0]) puts("00");
  if (v[1]) puts("01");
  if (v[2]) puts("10");
  if (v[3]) puts("11");
  return 0;
}
