#include <bits/stdc++.h>
int main() {
  char ch;
  int a[5] = {0}, i, count = 1, max = -10000, min = 10000, max_num, min_num, K;
  while (count <= 4) {
    scanf("%c", &ch);
    if (ch != '\n') {
      a[count]++;
    } else {
      a[count] -= 2;
      count++;
    }
  }
  for (i = 1; i <= 4; i++) {
    if (a[i] > max) {
      max = a[i];
      max_num = i;
    }
    if (a[i] < min) {
      min = a[i];
      min_num = i;
    }
  }
  for (i = 1; i <= 4; i++) {
    if (max < a[i] * 2 && max_num != i) {
      break;
    }
  }
  for (K = 1; K <= 4; K++) {
    if (2 * min > a[K] && min_num != K) {
      break;
    }
  }
  if (K == 5 && i != 5) {
    printf("%c", min_num + 'A' - 1);
  } else if (i == 5 && K != 5) {
    printf("%c", max_num + 'A' - 1);
  } else {
    printf("C");
  }
}
