#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, num0 = 0, num1 = 0, numx = 0;
  char ch;
  string s;
  cin >> s;
  for (i = 0; i < s.length(); i++) {
    ch = s.at(i);
    if (ch == '0')
      num0++;
    else if (ch == '1')
      num1++;
    else
      numx++;
  }
  if (num0 + numx > num1) cout << "00" << endl;
  if (((num1 + numx + num0) % 2 == 1 && (num1 + numx > num0) &&
       (num0 + numx >= num1 - 1)) ||
      ((num1 + numx + num0) % 2 == 0 && (num1 + numx >= num0) &&
       (num0 + numx >= num1))) {
    if ((ch == '1') ||
        ((ch == '?') && ((num0 + 1 == num1 + numx) || (num0 == num1 + numx))))
      cout << "01" << endl;
    else if ((ch == '0') || ((ch == '?') && ((num0 + numx == num1 - 1) ||
                                             (num0 + numx == num1))))
      cout << "10" << endl;
    else
      cout << "01\n10" << endl;
  }
  if (num1 + numx > num0 + 1) cout << "11" << endl;
  return 0;
}
