#include <bits/stdc++.h>
int main() {
  int i, j, l[4];
  char s[105];
  int n1, n2;
  int f, c = 0;
  for (i = 1; i <= 4; i++) {
    scanf("%s", &s);
    l[i] = strlen(s) - 2;
  }
  for (i = 1; i <= 4; i++) {
    n1 = 0;
    n2 = 0;
    for (j = 1; j <= 4; j++) {
      if (i != j) {
        if (l[i] <= l[j] / 2)
          n1++;
        else if (l[i] >= 2 * l[j])
          n2++;
      }
    }
    if (n1 == 3 || n2 == 3) {
      c++;
      f = i - 1;
    }
  }
  if (c == 1)
    printf("%c\n", 'A' + f);
  else
    printf("%c\n", 'C');
  return 0;
}
