#include <bits/stdc++.h>
using namespace std;
struct number {
  int sz;
  char s;
};
bool cmp(struct number a, struct number b) { return a.sz < b.sz; }
int main() {
  char a[105], b[105], c[105], d[105];
  struct number num[5];
  int i;
  while (scanf("%s%s%s%s", a, b, c, d) != EOF) {
    num[0].sz = strlen(a) - 2;
    num[1].sz = strlen(b) - 2;
    num[2].sz = strlen(c) - 2;
    num[3].sz = strlen(d) - 2;
    num[0].s = 'A';
    num[1].s = 'B';
    num[2].s = 'C';
    num[3].s = 'D';
    sort(num, num + 4, cmp);
    if (num[1].sz - num[0].sz * 2 >= 0 && num[3].sz - num[2].sz * 2 < 0)
      printf("%c\n", num[0].s);
    else if (num[3].sz - num[2].sz * 2 >= 0 && num[1].sz - num[0].sz * 2 < 0)
      printf("%c\n", num[3].s);
    else
      printf("C\n");
  }
  return 0;
}
