#include <bits/stdc++.h>
using namespace std;
const int maxn = int(1e5 + 10);
char s[maxn];
int a, b, c, n;
bool v[4];
char ans[4][3] = {"00", "01", "10", "11"};
int main() {
  cin >> s;
  n = strlen(s);
  for (int i = 0; i <= n - 1; i++)
    if (s[i] == '1')
      a++;
    else if (s[i] == '0')
      b++;
    else
      c++;
  if (a < b + c + (n & 1)) v[0] = 1;
  if (a + c > b + (n & 1)) v[3] = 1;
  int d = a - b - (n & 1);
  int t = c - abs(d);
  if (t >= 0 && (t % 2 == 0)) {
    char &x = s[n - 1];
    if (x == '0') v[2] = 1;
    if (x == '1') v[1] = 1;
    if (x == '?') {
      if (!t && d > 0 || t) v[2] = 1;
      if (!t && d < 0 || t) v[1] = 1;
    }
  }
  for (int i = 0; i <= 3; i++)
    if (v[i]) cout << ans[i] << endl;
  return 0;
}
