#include <bits/stdc++.h>
using namespace std;
char can[1000001];
bool ok00, ok01, ok10, ok11;
int f[1000001], v[1000001];
int main() {
  ok00 = false;
  ok01 = false;
  ok10 = false;
  ok11 = false;
  scanf("%s", can);
  int tot0 = 0, tot1 = 0, tot = 0;
  for (int i = 0; i < strlen(can); i++)
    if (can[i] == '0')
      ++tot0;
    else if (can[i] == '1')
      ++tot1;
    else
      ++tot;
  int m = strlen(can);
  if (!(m & 1)) {
    if (tot + tot0 > tot1) ok00 = true;
    if (tot + tot1 > tot0) ok11 = true;
    int TA = 0, TB = 0;
    int IA = m / 2 - tot0, IB = m / 2 - tot1;
    for (int i = 0; i < m; i++) {
      if (can[i] == '0')
        f[++TA] = i;
      else if (can[i] == '1')
        v[++TB] = i;
      else {
        if (IA)
          f[++TA] = i, --IA;
        else
          v[++TB] = i;
      }
    }
    if (TA == m / 2)
      if (f[TA] < v[TB])
        ok01 = true;
      else
        ok10 = true;
    TA = 0;
    TB = 0;
    IA = m / 2 - tot0, IB = m / 2 - tot1;
    for (int i = 0; i < m; i++) {
      if (can[i] == '0')
        f[++TA] = i;
      else if (can[i] == '1')
        v[++TB] = i;
      else {
        if (IB)
          v[++TB] = i, --IB;
        else
          f[++TA] = i;
      }
    }
    if (TA == m / 2)
      if (f[TA] < v[TB])
        ok01 = true;
      else
        ok10 = true;
  } else {
    if (tot + tot0 > tot1) ok00 = true;
    if (tot + tot1 - 1 > tot0) ok11 = true;
    int TA = 0, TB = 0;
    int IA = m / 2 - tot0, IB = m / 2 - tot1 + 1;
    for (int i = 0; i < m; i++) {
      if (can[i] == '0')
        f[++TA] = i;
      else if (can[i] == '1')
        v[++TB] = i;
      else {
        if (IA)
          f[++TA] = i, IA--;
        else
          v[++TB] = i;
      }
    }
    if (TA == m / 2)
      if (f[TA] < v[TB])
        ok01 = true;
      else
        ok10 = true;
    TA = 0;
    TB = 0;
    IA = m / 2 - tot0, IB = m / 2 - tot1 + 1;
    for (int i = 0; i < m; i++) {
      if (can[i] == '0')
        f[++TA] = i;
      else if (can[i] == '1')
        v[++TB] = i;
      else {
        if (IB)
          v[++TB] = i, --IB;
        else
          f[++TA] = i;
      }
    }
    if (TA == m / 2)
      if (f[TA] < v[TB])
        ok01 = true;
      else
        ok10 = true;
  }
  if (ok00) printf("00\n");
  if (ok01) printf("01\n");
  if (ok10) printf("10\n");
  if (ok11) printf("11\n");
}
