#include <bits/stdc++.h>
using namespace std;
char in[100049];
char tmp[100049];
int main() {
  gets(in);
  int zs = 0, os = 0, qs = 0;
  int len = strlen(in);
  for (int i = 0; i < (len); ++i) switch (in[i]) {
      case '0':
        ++zs;
        break;
      case '1':
        ++os;
        break;
      case '?':
        ++qs;
        break;
    }
  bool oc[2][2] = {{0}};
  int mz = zs + qs, mo = os + qs;
  char l = in[len - 1];
  if (len % 2 == 0) {
    if (mz > os) oc[0][0] = true;
    if (mo > zs) oc[1][1] = true;
    if (mo >= zs && mz >= os) {
      if (l == '0' || (l == '?' && mo - 1 >= zs + 1)) {
        oc[1][0] = true;
      }
      if (l == '1' || (l == '?' && mz - 1 >= os + 1)) {
        oc[0][1] = true;
      }
    }
  } else {
    if (mz > os - 1) oc[0][0] = true;
    if (mo - 1 > zs) oc[1][1] = true;
    if (mo - 1 >= zs && mz >= os - 1) {
      if (l == '0' || (l == '?' && mo - 2 >= zs + 1)) {
        oc[1][0] = true;
      }
      if (l == '1' || (l == '?' && mz - 1 >= os)) {
        oc[0][1] = true;
      }
    }
  }
  for (int i = 0; i < (2); ++i)
    for (int j = 0; j < (2); ++j)
      if (oc[i][j]) printf("%d%d\n", i, j);
  return 0;
}
