#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a[110000] = {}, b[110000] = {}, h = s.length();
  for (int i = 0; i < h; ++i) {
    a[i + 1] = a[i];
    b[i + 1] = b[i];
    if (s[i] == '0') {
      a[i + 1]++;
      b[i + 1]++;
    }
    if (s[i] == '?') b[i + 1]++;
  }
  int nm = (h - 2) / 2 + h % 2, np = h / 2 - 1;
  if (h - b[h] <= nm) cout << "00\n";
  if (s[h - 1] == '1' && np + 1 >= a[h] && np + 1 <= b[h])
    cout << "01\n";
  else if (s[h - 1] == '?' && np + 1 >= a[h] && np + 1 < b[h])
    cout << "01\n";
  if (s[h - 1] == '0' && np + 1 >= a[h] && np + 1 <= b[h])
    cout << "10\n";
  else if (s[h - 1] == '?' && nm + 1 >= h - b[h] && nm + 1 < h - a[h])
    cout << "10\n";
  if (a[h] <= np) cout << "11\n";
}
