#include <bits/stdc++.h>
using namespace std;
char str[100001];
char str2[100001];
int len;
int t1, t2;
string game() {
  int l1 = t1, l2 = t2;
  for (int i = 0; i < len; i++) {
    if (str2[i] == '1' && l1) {
      l1--;
      str2[i] = 'a';
    } else if (str2[i] == '0' && l2) {
      l2--;
      str2[i] = 'a';
    }
  }
  string ret;
  for (int i = 0; i < len; i++) {
    if (str2[i] != 'a') ret += str2[i];
    if (ret.size() == 2) break;
  }
  return ret;
}
int main(void) {
  int cnt[2] = {0, 0};
  scanf("%s", str);
  len = strlen(str);
  for (int i = 0; i < len; i++)
    if (str[i] == '0')
      cnt[0]++;
    else if (str[i] == '1')
      cnt[1]++;
  t1 = t2 = (len - 2) / 2;
  if ((len - 2) % 2) t1++;
  vector<string> ans;
  strcpy(str2, str);
  for (int i = 0; i < len; i++)
    if (str2[i] == '?') str2[i] = '0';
  if (game() == "00") ans.push_back("00");
  int toInsert = t1 + 1 - cnt[1];
  strcpy(str2, str);
  for (int i = len - 1; i >= 0; i--)
    if (str2[i] == '?' && toInsert > 0) {
      toInsert--;
      str2[i] = '1';
    }
  for (int i = 0; i < len; i++)
    if (str2[i] == '?') str2[i] = '0';
  if (game() == "01") ans.push_back("01");
  toInsert = t1 + 1 - cnt[1];
  strcpy(str2, str);
  for (int i = 0; i < len; i++)
    if (str2[i] == '?' && toInsert > 0) {
      toInsert--;
      str2[i] = '1';
    }
  for (int i = 0; i < len; i++)
    if (str2[i] == '?') str2[i] = '0';
  if (game() == "10") ans.push_back("10");
  strcpy(str2, str);
  for (int i = 0; i < len; i++)
    if (str2[i] == '?') str2[i] = '1';
  if (game() == "11") ans.push_back("11");
  for (int i = 0; i < ans.size(); i++) printf("%s\n", ans[i].c_str());
  return 0;
}
