#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
char str[N];
char dum[N];
int n;
string play() {
  deque<int> z, o;
  for (int i = 0; i < n; i++) {
    if (str[i] == '0')
      z.push_back(i);
    else
      o.push_back(i);
  }
  for (int i = 2; i < n; i++) {
    if (i & 1) {
      if (z.size()) {
        str[z[0]] = '#';
        z.pop_front();
      } else {
        str[o.back()] = '#';
        o.pop_back();
      }
    } else {
      if (o.size()) {
        str[o[0]] = '#';
        o.pop_front();
      } else {
        str[z.back()] = '#';
        z.pop_back();
      }
    }
  }
  string ans = "";
  for (int i = 0; i < n; i++) {
    if (str[i] != '#') ans.push_back(str[i]);
  }
  return ans;
}
int main() {
  scanf("%s", dum);
  n = strlen(dum);
  set<string> st;
  strcpy(str, dum);
  for (int i = 0; i < n; ++i) {
    if (str[i] == '?') str[i] = '0';
  }
  st.insert(play());
  strcpy(str, dum);
  for (int i = 0; i < n; ++i) {
    if (str[i] == '?') str[i] = '1';
  }
  st.insert(play());
  if (n % 2 == 0) {
    int z = 0, o = 0, q = 0;
    for (int i = 0; i < n; ++i) {
      if (dum[i] == '0')
        ++z;
      else if (dum[i] == '1')
        ++o;
      else
        ++q;
    }
    if (z * 2 <= n && o * 2 <= n) {
      int oo = (n / 2) - o, zz = (n / 2) - z;
      strcpy(str, dum);
      for (int i = 0; i < n; ++i) {
        if (str[i] == '?') {
          if (oo) {
            oo--;
            str[i] = '1';
          } else
            str[i] = '0';
        }
      }
      st.insert(play());
      strcpy(str, dum);
      for (int i = 0; i < n; ++i) {
        if (str[i] == '?') {
          if (zz) {
            zz--;
            str[i] = '0';
          } else
            str[i] = '1';
        }
      }
      st.insert(play());
    }
  } else {
    int z = 0, o = 0, q = 0;
    for (int i = 0; i < n; ++i) {
      if (dum[i] == '0')
        ++z;
      else if (dum[i] == '1')
        ++o;
      else
        ++q;
    }
    int oo = (n + 1) / 2, zz = n - oo;
    if (z <= zz && o <= oo) {
      zz -= z;
      oo -= o;
      strcpy(str, dum);
      for (int i = 0; i < n; ++i) {
        if (str[i] == '?') {
          if (oo) {
            oo--;
            str[i] = '1';
          } else
            str[i] = '0';
        }
      }
      st.insert(play());
      strcpy(str, dum);
      for (int i = 0; i < n; ++i) {
        if (str[i] == '?') {
          if (zz) {
            zz--;
            str[i] = '0';
          } else
            str[i] = '1';
        }
      }
      st.insert(play());
    }
  }
  for (auto x : st) cout << x << "\n";
}
