#include <bits/stdc++.h>
using namespace std;
const int INF = 99999999;
const int MX = 1000 + 10;
using namespace std;
char s1[MX], s2[MX], s3[MX], s4[MX];
bool judge(int x1, int x2, int x3, int x4) {
  if ((x1 * 2 <= x2 && x1 * 2 <= x3 && x1 * 2 <= x4) ||
      (x1 >= x2 * 2 && x1 >= x3 * 2 && x1 >= x4 * 2))
    return true;
  return false;
}
int main() {
  while (~scanf("%s%s%s%s", s1, s2, s3, s4)) {
    int n1 = strlen(s1) - 2;
    int n2 = strlen(s2) - 2;
    int n3 = strlen(s3) - 2;
    int n4 = strlen(s4) - 2;
    int num = 0;
    char ch;
    if (judge(n1, n2, n3, n4)) ch = 'A', num++;
    if (judge(n2, n1, n3, n4)) ch = 'B', num++;
    if (judge(n3, n1, n2, n4)) ch = 'C', num++;
    if (judge(n4, n1, n2, n3)) ch = 'D', num++;
    if (num == 1)
      cout << ch << endl;
    else
      cout << 'C' << endl;
  }
  return 0;
}
