#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<long long> nums;
long long curr;
string s;
char ult;
int x;
int chars[3];
bool posibles[4];
int main() {
  cin >> s;
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] == '?')
      ++chars[2];
    else
      ++chars[s[i] - '0'];
  }
  ult = s[s.length() - 1];
  if (chars[2] == 0) {
    if (chars[1] < chars[0])
      posibles[0] = true;
    else if (chars[1] > chars[0] + 1)
      posibles[3] = true;
    else if (ult == '1')
      posibles[1] = true;
    else if (ult == '0')
      posibles[2] = true;
  } else {
    if (chars[1] < chars[0] + chars[2]) posibles[0] = true;
    if (chars[0] + 1 < chars[1] + chars[2]) posibles[3] = true;
    if (ult == '1') {
      x = (chars[0] + chars[2] - chars[1] +
           (chars[1] + chars[2] + chars[0]) % 2) /
          2;
      if (x >= 0 && x <= chars[2]) posibles[1] = true;
    } else if (ult == '?') {
      chars[2]--;
      chars[1]++;
      x = (chars[0] + chars[2] - chars[1] +
           (chars[1] + chars[2] + chars[0]) % 2) /
          2;
      if (x >= 0 && x <= chars[2]) posibles[1] = true;
      chars[2]++;
      chars[1]--;
    }
    if (ult == '0') {
      x = (chars[0] + chars[2] - chars[1] +
           (chars[1] + chars[2] + chars[0]) % 2) /
          2;
      if (x >= 0 && x <= chars[2]) posibles[2] = true;
    } else if (ult == '?') {
      chars[2]--;
      chars[0]++;
      x = (chars[0] + chars[2] - chars[1] +
           (chars[1] + chars[2] + chars[0]) % 2) /
          2;
      if (x >= 0 && x <= chars[2]) posibles[2] = true;
      chars[2]++;
      chars[0]--;
    }
  }
  if (posibles[0]) cout << "00" << '\n';
  if (posibles[1]) cout << "01" << '\n';
  if (posibles[2]) cout << "10" << '\n';
  if (posibles[3]) cout << "11" << '\n';
  return 0;
}
