#include <bits/stdc++.h>
using namespace std;
const int inf = 100000001;
string s;
int t[3];
int main() {
  ios::sync_with_stdio(false);
  cin >> s;
  for (int i = 0; i < ((int)(s).size()); i++) {
    if (s[i] == '?')
      t[2]++;
    else
      t[s[i] - '0']++;
  }
  if (t[0] + t[2] > t[1]) cout << "00" << endl;
  if ((s[((int)(s).size()) - 1] == '1' && t[0] + t[2] >= t[1] - 1 &&
       t[1] + t[2] >= t[0]) ||
      (s[((int)(s).size()) - 1] == '?' && t[0] + t[2] > t[1] &&
       t[1] + t[2] >= t[0]))
    cout << "01" << endl;
  if ((s[((int)(s).size()) - 1] == '0' && t[0] + t[2] >= t[1] - 1 &&
       t[1] + t[2] >= t[0]) ||
      (s[((int)(s).size()) - 1] == '?' && t[0] + t[2] >= t[1] - 1 &&
       t[1] + t[2] > t[0] + 1))
    cout << "10" << endl;
  if (t[1] + t[2] > t[0] + 1) cout << "11" << endl;
  return 0;
}
