#include <bits/stdc++.h>
char str[1000010] = {0};
int main() {
  scanf("%s", str);
  int i;
  int one = 0, zero = 0, unknown = 0;
  int appear[4] = {0, 0, 0, 0};
  int n;
  int masha, petya;
  for (i = 0; str[i]; i++)
    if (str[i] == '?')
      unknown++;
    else if (str[i] == '1')
      one++;
    else if (str[i] == '0')
      zero++;
  n = one + zero + unknown;
  masha = (n - 1) / 2;
  petya = (n - 2) / 2;
  if (one <= masha) appear[0] = 1;
  if (zero <= petya) appear[3] = 1;
  if (one == masha + 1) {
    if (str[n - 1] == '1')
      appear[1] = 1;
    else
      appear[2] = 1;
  } else if (one <= masha && one + unknown > masha) {
    if (str[n - 1] == '1')
      appear[1] = 1;
    else if (str[n - 1] == '0')
      appear[2] = 1;
    else if (one + unknown == masha + 1)
      appear[1] = 1;
    else
      appear[1] = appear[2] = 1;
  }
  for (i = 0; i <= 3; i++)
    if (appear[i]) printf("%d%d\n", i / 2, i & 1);
  return 0;
}
