#include <bits/stdc++.h>
using namespace std;
int main() {
  int count0 = 0, count1 = 0, countq = 0;
  string s;
  cin >> s;
  count0 = count(s.begin(), s.end(), '0');
  count1 = count(s.begin(), s.end(), '1');
  countq = count(s.begin(), s.end(), '?');
  int minimize_turn = (s.length() - 2 + 1) / 2;
  int maximize_turn = (s.length() - 2) / 2;
  if (count0 + countq >= maximize_turn + 2) {
    puts("00");
  }
  if (count1 <= minimize_turn + 1 && count1 + countq >= minimize_turn + 1) {
    bool can_be_zero = count1 + countq > minimize_turn + 1;
    bool can_be_one = count0 + countq > maximize_turn + 1;
    bool ok = false;
    for (int i = (int)s.size() - 1; i >= 0; --i) {
      if (s[i] == '0' || (s[i] == '?' && !can_be_one)) break;
      if (s[i] == '1' || (s[i] == '?' && can_be_one)) {
        ok = true;
        break;
      }
    }
    if (ok) puts("01");
    ok = false;
    for (int i = (int)s.size() - 1; i >= 0; --i) {
      if (s[i] == '1' || (s[i] == '?' && !can_be_zero)) break;
      if (s[i] == '0' || (s[i] == '?' && can_be_zero)) {
        ok = true;
        break;
      }
    }
    if (ok) puts("10");
  }
  if (count1 + countq >= minimize_turn + 2) {
    puts("11");
  }
  return 0;
}
