#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 10;
int n;
char S[N];
int main() {
  scanf("%s", S + 1);
  n = strlen(S + 1);
  int c0 = 0, c1 = 0;
  for (int i = 1; i <= n; ++i) {
    if (S[i] == '0') c0++;
    if (S[i] == '1') c1++;
  }
  bool ans[4] = {false};
  if (n % 2 == 0) {
    if (c0 <= n / 2 && c1 <= n / 2) {
      if (S[n] == '1' || (c1 < n / 2 && S[n] == '?')) ans[1] = true;
      if (S[n] == '0' || (c0 < n / 2 && S[n] == '?')) ans[2] = true;
    }
    if (c1 < n / 2) ans[0] = true;
    if (c0 < n / 2) ans[3] = true;
  } else {
    if (c0 <= n / 2 && c1 - 1 <= n / 2) {
      if (S[n] == '1' || (c1 - 1 < n / 2 && S[n] == '?')) ans[1] = true;
      if (S[n] == '0' || (c0 < n / 2 && S[n] == '?')) ans[2] = true;
    }
    if (c1 - 1 < n / 2) ans[0] = true;
    if (c0 < n / 2) ans[3] = true;
  }
  for (int i = 0; i < 4; ++i)
    if (ans[i]) printf("%d%d\n", i >> 1, i & 1);
  return 0;
}
