#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
template <class _T>
inline string tostr(const _T& a) {
  ostringstream os("");
  os << a;
  return os.str();
}
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-9;
char C[100500];
string s, t;
int z, o;
vector<int> v;
int a[5];
void play(string z) {
  int L = 0, R = 0, now = 0, all = z.size();
  while (true) {
    if (all == 2) break;
    if (now == 0) {
      while (L < z.size()) {
        if (z[L] == '1') {
          z[L] = ' ';
          now = 1;
          all--;
          break;
        }
        L++;
      }
      if (L == z.size()) break;
    } else {
      while (R < z.size()) {
        if (z[R] == '0') {
          z[R] = ' ';
          now = 0;
          all--;
          break;
        }
        R++;
      }
      if (R == z.size()) break;
    }
  }
  string res = "";
  for (int i = 0; i < z.size(); i++) {
    if (z[i] != ' ') res += z[i];
  }
  int x = (res[0] - '0') * 2 + (res[1] - '0');
  a[x] = 1;
}
void rec(int x) {
  if (x == v.size()) {
    play(t);
    return;
  }
  t[v[x]] = '0';
  rec(x + 1);
  t[v[x]] = '1';
  rec(x + 1);
}
int main() {
  cout.flags(ios::fixed);
  cout.precision(2);
  gets(C);
  s = C;
  z = 0;
  o = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') z++;
    if (s[i] == '1') o++;
  }
  t = s;
  for (int i = 0; i < s.size(); i++) {
    if (t[i] == '?') {
      if (z > o) {
        t[i] = '1';
        o++;
      } else {
        t[i] = '0';
        z++;
      }
    }
  }
  memset((a), 0, sizeof(a));
  play(t);
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '?') {
      v.push_back(i);
      if (v.size() == 5) break;
    }
  }
  rec(0);
  for (int i = 0; i < 4; i++) {
    if (a[i]) {
      if (i > 1)
        cout << 1;
      else
        cout << 0;
      if (i & 1)
        cout << 1;
      else
        cout << 0;
      cout << endl;
    }
  }
  return 0;
}
