#include <bits/stdc++.h>
int l[4];
bool judge1(int x);
bool judge2(int x);
int main(void) {
  char str[105];
  for (int i = 0; i < 4; i++) {
    scanf("%s", str);
    l[str[0] - 'A'] = strlen(str + 2);
  }
  int flag = 0, ans = 0;
  for (int i = 0; i < 4; i++) {
    if (judge1(i) || judge2(i)) {
      flag++;
      ans = i;
    }
  }
  if (flag == 1)
    printf("%c\n", ans + 'A');
  else
    printf("C\n");
  return 0;
}
bool judge1(int x) {
  for (int i = 0; i < 4; i++) {
    if (i == x) continue;
    if (l[i] * 2 > l[x]) return false;
  }
  return true;
}
bool judge2(int x) {
  for (int i = 0; i < 4; i++) {
    if (i == x) continue;
    if (l[i] < l[x] * 2) return false;
  }
  return true;
}
