#include <bits/stdc++.h>
using namespace std;
bool check(int x, int y, int z) {
  return ((y <= x && (x - y) <= z) || (x <= y && (y - x - 1) <= z));
}
int main() {
  int x = 0, y = 0, z = 0;
  vector<int> a;
  while (true) {
    char c;
    scanf("%c", &c);
    if (c == '0') {
      a.push_back(0);
      ++x;
    } else if (c == '1') {
      a.push_back(1);
      ++y;
    } else if (c == '?') {
      a.push_back(-1);
      ++z;
    } else
      break;
  }
  vector<pair<int, int>> ans;
  if (y + z - x > 1) {
    ans.push_back({1, 1});
  }
  if (x + z - y > 0) {
    ans.push_back({0, 0});
  }
  if ((y <= x && (x - y) <= z) || (x <= y && (y - x - 1) <= z)) {
    if (a.back() == 0 || (a.back() == -1 && check(x + 1, y, z - 1))) {
      ans.push_back({1, 0});
    }
    if (a.back() == 1 || (a.back() == -1 && check(x, y + 1, z - 1))) {
      ans.push_back({0, 1});
    }
  }
  sort(ans.begin(), ans.end());
  for (auto i : ans) {
    printf("%d%d\n", i.first, i.second);
  }
}
