#include <bits/stdc++.h>
int x4[4] = {0, 0, -1, 1};
int y4[4] = {-1, 1, 0, 0};
int x8[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int y8[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
int xhorse[8] = {1, 2, 1, 2, -1, -2, -1, -2};
int yhorse[8] = {2, 1, -2, -1, 2, 1, -2, -1};
using namespace std;
char s[200005];
int len;
int q, one, zero;
set<string> myset;
int main() {
  myset.clear();
  scanf("%s", s);
  len = strlen(s);
  q = one = zero = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] == '?')
      q++;
    else if (s[i] == '1')
      one++;
    else
      zero++;
  }
  int plusOne = 0;
  int plusZero = 0;
  int to, tz;
  for (int i = 0; i <= q; i++) {
    plusOne = i;
    plusZero = q - i;
    to = plusOne + one;
    tz = plusZero + zero;
    if (to - tz >= 2)
      myset.insert("11");
    else if (tz - to >= 1)
      myset.insert("00");
    else {
      if (s[len - 1] == '0')
        myset.insert("10");
      else if (s[len - 1] == '1')
        myset.insert("01");
      else {
        if (plusOne == 0)
          myset.insert("10");
        else if (plusZero == 0)
          myset.insert("01");
        else {
          myset.insert("10");
          myset.insert("01");
        }
      }
    }
  }
  for (set<string>::iterator it = myset.begin(); it != myset.end(); it++) {
    printf("%s\n", (*it).c_str());
  }
  return 0;
}
