#include <bits/stdc++.h>
int main() {
  int a[4], b = 0, c = 0, d = 0, e;
  a[1] = a[2] = a[3] = a[0] = 0;
  char m[] = "ABCD";
  char s[4][200];
  for (int i = 0; i < 4; i++) {
    scanf("%s", s[i]);
    a[i] = strlen(s[i]) - 2;
  }
  for (int i = 0; i < 4; i++) {
    c = 0;
    d = 0;
    int f = b;
    if (i == 0)
      d = a[i + 1];
    else
      d = a[0];
    for (int j = 0; j < 4; j++) {
      if (i != j) {
        if (d > a[i] && a[i] * 2 <= a[j] && (c == 0 || c == 1)) {
          c = 1;
        } else if (d < a[i] && a[i] >= a[j] * 2 && (c == 0 || c == 2)) {
          c = 2;
        } else
          c = 3;
      }
    }
    if (c < 3) {
      b++;
    }
    if (b > f) {
      e = i;
    }
  }
  if (b == 1) {
    printf("%c", m[e]);
  } else
    printf("C");
}
