#include <bits/stdc++.h>
using namespace std;
string a[4], b, c, d;
int main() {
  vector<int> A, B;
  char g1 = ' ', g2 = ' ';
  char C[] = "ABCD";
  A.resize(4);
  B.resize(4);
  for (int i = 0; i < 4; ++i) {
    cin >> a[i];
    A[i] = a[i].size() - 2;
    B[i] = A[i];
  }
  sort(B.begin(), B.end());
  if (B[0] <= B[1] / 2) {
    for (int i = 0; i < 4; ++i) {
      if (a[i].size() == B[0] + 2) {
        g1 = C[i];
      }
    }
  }
  if (B[3] >= B[2] * 2) {
    for (int i = 0; i < 4; ++i) {
      if (a[i].size() == B[3] + 2) {
        g2 = C[i];
      }
    }
  }
  if ((g1 == ' ' && g2 == ' ') || (g1 != ' ' && g2 != ' '))
    cout << "C";
  else {
    if (g1 != ' ')
      cout << g1;
    else
      cout << g2;
  }
  return 0;
}
