#include <bits/stdc++.h>
using namespace std;
const int N = 101000;
char data[N];
int rec[3];
int a[4];
int main() {
  while (scanf("%s", data) != EOF) {
    memset(a, 0, sizeof(a));
    memset(rec, 0, sizeof(rec));
    int i;
    int len = strlen(data);
    int cnt = 0;
    for (i = 0; i < len; i++) {
      switch (data[i]) {
        case '0':
          rec[0]++;
          break;
        case '1':
          rec[1]++;
          break;
        case '?':
          rec[2]++;
          break;
      }
    }
    if (rec[0] + rec[2] - rec[1] >= 1) a[0] = 1;
    if (rec[1] + rec[2] - rec[0] >= 2) a[3] = 1;
    if (len % 2 == 0) {
      if (abs(rec[1] - rec[0]) <= rec[2]) {
        if (abs(rec[1] - rec[0]) == rec[2] && data[len - 1] == '?') {
          if (rec[1] < rec[0])
            data[len - 1] = '1';
          else
            data[len - 1] = '0';
        }
        if (data[len - 1] == '1')
          a[1] = 1;
        else if (data[len - 1] == '0')
          a[2] = 1;
        else
          a[1] = a[2] = 1;
      }
    } else {
      if (rec[1] == 0)
        rec[2]--;
      else
        rec[1] -= 1;
      if (abs(rec[1] - rec[0]) <= rec[2]) {
        if (abs(rec[1] - rec[0]) == rec[2] && data[len - 1] == '?') {
          if (rec[1] < rec[0])
            data[len - 1] = '1';
          else
            data[len - 1] = '0';
        }
        if (data[len - 1] == '1')
          a[1] = 1;
        else if (data[len - 1] == '0')
          a[2] = 1;
        else
          a[1] = a[2] = 1;
      }
    }
    for (i = 0; i < 4; i++)
      if (a[i] == 1) printf("%d%d\n", i / 2, i % 2);
  }
}
