#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000 * 1000 + 100;
int res[4], can[maxN];
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int one = 0, x = 0, n = s.size(), zero = 0;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == '1')
      one++;
    else if (s[i] == '?')
      x++;
    else
      zero++;
  int m = (n + 1) / 2;
  if (one + x > m) res[3] = 1;
  if (one < m) res[0] = 1;
  for (int i = 0; i <= x; i++) can[one + i] = 1;
  if (can[m]) {
    char y = s[s.size() - 1];
    if (y == '0')
      res[2] = 1;
    else if (y == '1')
      res[1] = 1;
    else {
      if (m == one)
        res[2] = 1;
      else if (m == one + x)
        res[1] = 1;
      else
        res[2] = res[1] = 1;
    }
  }
  for (int i = 0; i < 4; i++)
    if (res[i]) cout << i / 2 << i % 2 << endl;
  return 0;
}
