#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:268435456")
using namespace std;
template <class T>
T abs(T &x) {
  return (x >= 0) ? (x) : (-x);
}
template <class T>
T sqr(T &x) {
  return (x) * (x);
}
template <class T>
T min(T &a, T &b) {
  return (a < b) ? (a) : (b);
}
template <class T>
T max(T &a, T &b) {
  return (a > b) ? (a) : (b);
}
int n;
char s[100500], tmp[100500];
set<string> ans;
int first, last, ones = 0, zeros = 0, signs = 0, need1, need2;
void calc() {
  for (first = 0; first < n; first++)
    if (s[first] == '?') break;
  for (last = n - 1; last >= 0; last--)
    if (s[last] == '?') break;
  ones = 0;
  zeros = 0;
  signs = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == '0')
      zeros++;
    else if (s[i] == '1')
      ones++;
    else
      signs++;
  need1 = (n - 1) / 2;
  need2 = (n - 2) / 2;
}
void save() {
  for (int i = 0; i < n; i++) tmp[i] = s[i];
}
void load() {
  for (int i = 0; i < n; i++) s[i] = tmp[i];
}
void check() {
  int len = n;
  if (need1 > ones) {
    need1 -= ones;
    ones = 0;
  } else {
    ones -= need1;
    need1 = 0;
  }
  if (need2 > zeros) {
    need2 -= zeros;
    zeros = 0;
  } else {
    zeros -= need2;
    need2 = 0;
  }
  if (ones == 0) ans.insert("00");
  if (zeros == 0) ans.insert("11");
  if (ones == 1 && zeros == 1) {
    if (s[n - 1] == '0')
      ans.insert("10");
    else
      ans.insert("01");
  }
}
void go1() {
  calc();
  for (int i = 0; i < n; i++)
    if (s[i] == '?') s[i] = '0';
  calc();
  check();
}
void go2() {
  calc();
  for (int i = 0; i < n; i++)
    if (s[i] == '?') s[i] = '1';
  calc();
  check();
}
void go3() {
  calc();
  int x = ones;
  for (int i = 0; i < n; i++)
    if (s[i] == '?') {
      if (x < need1 + 1) {
        s[i] = '1';
        x++;
      } else {
        s[i] = '0';
      }
    }
  calc();
  check();
}
void go4() {
  calc();
  int x = zeros;
  for (int i = 0; i < n; i++)
    if (s[i] == '?') {
      if (x < need2 + 1) {
        s[i] = '0';
        x++;
      } else {
        s[i] = '1';
      }
    }
  calc();
  check();
}
int main() {
  scanf("%s", s);
  n = strlen(s);
  save();
  go1();
  load();
  save();
  go2();
  load();
  save();
  go3();
  load();
  save();
  go4();
  load();
  for (set<string>::iterator it = ans.begin(); it != ans.end(); it++)
    cout << *it << endl;
}
