#include <bits/stdc++.h>
using namespace std;
void up_min(int &x, int y) {
  if ((x > y) || (x == -1)) x = y;
}
char ch[100050];
int main() {
  while (cin >> ch) {
    int n = strlen(ch);
    int n0 = 0, n1 = 0, nn = 0;
    for (int i = 0; i < n; ++i) {
      if (ch[i] == '0')
        n0++;
      else if (ch[i] == '1')
        n1++;
      else if (ch[i] == '?')
        nn++;
    }
    if (n1 < n0 + nn) puts("00");
    if (ch[n - 1] != '0') {
      bool ok = 0;
      int c0 = n0, c1 = n1, c2 = nn;
      if (ch[n - 1] == '?') {
        c1++, c2--;
      }
      int t = c2 + c0 - c1;
      if (t % 2 == 0) {
        if (0 <= t / 2 && t / 2 <= c2) ok = 1;
      } else if (0 <= (t + 1) / 2 && (t + 1) / 2 <= c2)
        ok = 1;
      if (ok) puts("01");
    }
    if (ch[n - 1] != '1') {
      bool ok = 0;
      int c0 = n0, c1 = n1, c2 = nn;
      if (ch[n - 1] == '?') {
        c0++, c2--;
      }
      int t = c2 + c0 - c1;
      if (t % 2 == 0) {
        if (0 <= t / 2 && t / 2 <= c2) ok = 1;
      } else if (0 <= (t + 1) / 2 && (t + 1) / 2 <= c2)
        ok = 1;
      if (ok) puts("10");
    }
    if (n1 + nn > n0 + 1) puts("11");
  }
}
