#include <bits/stdc++.h>
int main() {
  char s[5][1007];
  int a[5];
  for (int i = 1; i <= 4; i++) {
    gets(s[i]);
    a[i] = strlen(s[i]) - 2;
  }
  int count1, count2;
  int t;
  int z = 0;
  for (int i = 1; i <= 4; i++) {
    count1 = count2 = 0;
    for (int j = 1; j <= 4; j++) {
      if ((a[i] - a[j] * 2) >= 0) count1++;
      if ((a[j] - a[i] * 2) >= 0) count2++;
    }
    if (count1 == 3 || count2 == 3) {
      t = i;
      z++;
    }
  }
  if (z == 1) {
    if (t == 1) printf("A\n");
    if (t == 2) printf("B\n");
    if (t == 3) printf("C\n");
    if (t == 4) printf("D\n");
  } else
    printf("C\n");
  return 0;
}
