#include <bits/stdc++.h>
using namespace std;
char cho[4][200];
int main() {
  int len[4];
  int c = 0;
  int ans = -1;
  for (int i = 0; i < 4; i++) {
    scanf("%s", cho[i]);
    len[i] = strlen(cho[i]) - 2;
  }
  for (int i = 0; i < 4; i++) {
    if (len[i] * 2 <= len[(i + 1) % 4] && len[i] * 2 <= len[(i + 2) % 4] &&
        len[i] * 2 <= len[(i + 3) % 4]) {
      c++;
      ans = i;
      continue;
    }
    if (len[i] >= 2 * len[(i + 1) % 4] && len[i] >= 2 * len[(i + 2) % 4] &&
        len[i] >= 2 * len[(i + 3) % 4]) {
      c++;
      ans = i;
      continue;
    }
  }
  if (c == 1)
    printf("%c\n", 'A' + ans);
  else
    printf("C\n");
  return 0;
}
