#include <bits/stdc++.h>
using namespace std;
const int N = 10004;
string s;
int c0 = 0, c1 = 0, cw = 0;
set<string> st;
int main() {
  cin >> s;
  for (char ch : s) {
    if (ch == '0')
      ++c0;
    else if (ch == '1')
      ++c1;
    else
      ++cw;
  }
  int n = s.size();
  if (c0 + cw - c1 >= 1) st.insert("00");
  if (c1 + cw - c0 >= 2) st.insert("11");
  int d1 = min(cw, max((n + 1) / 2 - c1, 0));
  int d0 = max(cw - d1, 0);
  if (d0 + c0 == n / 2 && c1 + d1 == (n + 1) / 2) {
    string t = s;
    int cd1 = d1, cd0 = d0;
    for (char &ch : t) {
      if (ch == '?') {
        if (cd1 > 0)
          ch = '1', --cd1;
        else
          ch = '0';
      }
    }
    if (t[n - 1] == '0') st.insert("10");
    t = s;
    for (char &ch : t) {
      if (ch == '?') {
        if (cd0 > 0)
          ch = '0', --cd0;
        else
          ch = '1';
      }
    }
    if (t[n - 1] == '1') st.insert("01");
  }
  for (string s : st) cout << s << endl;
}
