#include <bits/stdc++.h>
int lnum[4], snum[4], ynum[4];
int main(void) {
  int i, l, j, number = 0, b = 0, m = 0, n = 0;
  char num[10000];
  for (i = 0; i < 4; i++) {
    scanf("%s", num);
    l = strlen(num);
    l -= 2;
    ynum[i] = l;
    lnum[i] = 2 * l;
    snum[i] = l / 2;
  }
  for (i = 0; i < 4; i++) {
    m = 0;
    n = 0;
    for (j = 0; j < 4; j++) {
      if (ynum[i] >= lnum[j]) m++;
      if (ynum[i] <= snum[j]) n++;
    }
    if (m > 2 || n > 2) {
      number = i + 1;
      b++;
    }
  }
  if (b == 1) {
    if (number == 1)
      printf("A\n");
    else if (number == 2)
      printf("B\n");
    else if (number == 3)
      printf("C\n");
    else
      printf("D\n");
  } else
    printf("C\n");
  return 0;
}
