#include <bits/stdc++.h>
const double eps = 1e-8;
const double pi = 3.1415926535897932;
const long long I64M = 1000000LL * 1000000LL * 1000000LL;
using namespace std;
ifstream in("input.txt", ifstream::in);
ofstream out("output.txt", ofstream::out);
int main(int argc, char** argv) {
  string s;
  cin >> s;
  int n0 = 0, n1 = 0, nq = 0;
  bool ans00, ans01, ans10, ans11;
  ans00 = ans01 = ans10 = ans11 = false;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '0') {
      n0++;
    } else if (s[i] == '1') {
      n1++;
    } else {
      nq++;
    }
  }
  if (nq == 0) {
    if (n1 < n0)
      ans00 = true;
    else if (n0 + 1 < n1)
      ans11 = true;
    else {
      if (s[s.length() - 1] == '1')
        ans01 = true;
      else
        ans10 = true;
    }
  } else {
    if (n1 < n0 + nq)
      ans00 = true;
    else if (n1 == n0 + nq || n1 - 1 == n0 + nq) {
      if (s[s.length() - 1] != '1')
        ans10 = true;
      else
        ans01 = true;
    }
    if (n0 + 1 < n1 + nq)
      ans11 = true;
    else if (n0 + 1 == n1 + nq || n0 == n1 + nq) {
      if (s[s.length() - 1] != '0')
        ans01 = true;
      else
        ans10 = true;
    }
    for (int q = 1; q < nq; q++) {
      if (n1 + q < n0 + nq - q) ans00 = true;
      if (n0 + q + 1 < n1 + nq - q) ans11 = true;
      if ((n0 + q == n1 + nq - q) || (n0 + q == n1 + nq - 1 - q)) {
        if (s[s.length() - 1] == '1')
          ans01 = true;
        else if (s[s.length() - 1] == '0')
          ans10 = true;
        else {
          ans10 = ans01 = true;
        }
      }
    }
  }
  if (ans00) cout << "00\n";
  if (ans01) cout << "01\n";
  if (ans10) cout << "10\n";
  if (ans11) cout << "11\n";
  return 0;
}
