#include <bits/stdc++.h>
using namespace std;
void solve(int test_number);
int main() {
  cout.setf(ios::fixed);
  cout.precision(9);
  cerr.setf(ios::fixed);
  cerr.precision(3);
  int n = 1;
  for (int i = 0; i < n; i++) {
    solve(i + 1);
  }
  return 0;
}
string ss;
int cnt0, cnt1, cntq;
bool check00() { return cnt0 + cntq > cnt1; }
bool check01() {
  int cntq = ::cntq;
  int cnt0 = ::cnt0;
  int cnt1 = ::cnt1;
  string s = ss;
  if (s[s.length() - 1] == '0') return false;
  if (s[s.length() - 1] == '?') {
    s[s.length() - 1] = '1';
    cntq--;
    cnt1++;
  }
  if (s.length() % 2 == 0) {
    int diff = abs(cnt1 - cnt0);
    if (cntq < diff) return false;
    if ((cntq - diff) % 2 == 1) return false;
    return true;
  } else {
    if (cnt1 > cnt0) {
      int diff = cnt1 - 1 - cnt0;
      if (cntq < diff) return false;
      if ((cntq - diff) % 2 == 1) return false;
      return true;
    } else {
      int diff = cnt0 + 1 - cnt1;
      if (cntq < diff) return false;
      if ((cntq - diff) % 2 == 1) return false;
      return true;
    }
  }
}
bool check10() {
  int cntq = ::cntq;
  int cnt0 = ::cnt0;
  int cnt1 = ::cnt1;
  string s = ss;
  if (s[s.length() - 1] == '1') return false;
  if (s[s.length() - 1] == '?') {
    s[s.length() - 1] = '0';
    cntq--;
    cnt0++;
  }
  if (s.length() % 2 == 0) {
    int diff = abs(cnt1 - cnt0);
    if (cntq < diff) return false;
    if ((cntq - diff) % 2 == 1) return false;
    return true;
  } else {
    if (cnt1 > cnt0) {
      int diff = cnt1 - 1 - cnt0;
      if (cntq < diff) return false;
      if ((cntq - diff) % 2 == 1) return false;
      return true;
    } else {
      int diff = cnt0 + 1 - cnt1;
      if (cntq < diff) return false;
      if ((cntq - diff) % 2 == 1) return false;
      return true;
    }
  }
}
bool check11() { return cnt1 + cntq > cnt0 + 1; }
void solve(int test_number) {
  cin >> ss;
  string s = ss;
  for (int i = 0; i < (int)s.length(); i++)
    if (s[i] == '0')
      cnt0++;
    else if (s[i] == '1')
      cnt1++;
    else
      cntq++;
  if (check00()) cout << "00\n";
  if (check01()) cout << "01\n";
  if (check10()) cout << "10\n";
  if (check11()) cout << "11\n";
}
