#include <bits/stdc++.h>
using namespace std;
char chA[150], chB[150], chC[150], chD[150];
int t, len1, len2, len3, len4;
char p;
int main() {
  while (cin >> chA) {
    cin >> chB;
    cin >> chC;
    cin >> chD;
    len1 = strlen(chA);
    len1 -= 2;
    len2 = strlen(chB);
    len2 -= 2;
    len3 = strlen(chC);
    len3 -= 2;
    len4 = strlen(chD);
    len4 -= 2;
    t = 0;
    p = 'k';
    if (len1 <= len2 / 2 && len1 <= len3 / 2 && len1 <= len4 / 2) {
      p = 'A';
      t++;
    }
    if (len1 >= len2 * 2 && len1 >= len3 * 2 && len1 >= len4 * 2) {
      p = 'A';
      t++;
    }
    if (len2 <= len1 / 2 && len2 <= len3 / 2 && len2 <= len4 / 2) {
      p = 'B';
      t++;
    }
    if (len2 >= len1 * 2 && len2 >= len3 * 2 && len2 >= len4 * 2) {
      p = 'B';
      t++;
    }
    if (len3 <= len1 / 2 && len3 <= len2 / 2 && len3 <= len4 / 2) {
      p = 'C';
      t++;
    }
    if (len3 >= len1 * 2 && len3 >= len2 * 2 && len3 >= len4 * 2) {
      p = 'C';
      t++;
    }
    if (len4 <= len1 / 2 && len4 <= len2 / 2 && len4 <= len3 / 2) {
      p = 'D';
      t++;
    }
    if (len4 >= len1 * 2 && len4 >= len2 * 2 && len4 >= len3 * 2) {
      p = 'D';
      t++;
    }
    if (t != 1)
      cout << "C\n";
    else
      cout << p << endl;
  }
  return 0;
}
