#include <bits/stdc++.h>
using namespace std;
set<string> uni(set<string> a, set<string> b) {
  for (set<string>::iterator i = b.begin(); i != b.end(); i++) a.insert(*i);
  return (a);
}
string find(string st) {
  int one = 0, zero = 0;
  for (int i = 0; i < st.size(); i++)
    if (st[i] == '1')
      one++;
    else
      zero++;
  if (one == zero + 1 || one == zero) {
    if (st[st.size() - 1] == '1')
      return ("01");
    else
      return ("10");
  }
  if (one > zero)
    return ("11");
  else
    return ("00");
}
set<string> cal(string s) {
  string x = s, y = s;
  for (int i = 0; i < x.size(); i++)
    if (x[i] == '?') x[i] = '1';
  for (int i = 0; i < y.size(); i++)
    if (y[i] == '?') y[i] = '0';
  string X = find(x);
  string Y = find(y);
  if (X == Y) {
    set<string> ret;
    ret.insert(X);
    return (ret);
  } else {
    set<string> ret;
    ret.insert(X);
    ret.insert(Y);
    string temp;
    temp += s[s.size() - 1];
    temp += temp[0] ^ 1;
    reverse(temp.begin(), temp.end());
    ret.insert(temp);
    return (ret);
  }
}
int main() {
  string st;
  cin >> st;
  set<string> result;
  if (st[st.size() - 1] == '?') {
    st[st.size() - 1] = '0';
    result = cal(st);
    st[st.size() - 1] = '1';
    result = uni(result, cal(st));
  } else
    result = cal(st);
  for (set<string>::iterator i = result.begin(); i != result.end(); i++)
    cout << *i << endl;
}
