#include <bits/stdc++.h>
using namespace std;
bool great(int w, int x, int y, int z) {
  return ((w >= x * 2 && w >= y * 2 && w >= z * 2) ||
          (w <= x / 2 && w <= y / 2 && w <= z / 2));
}
int main() {
  int ai, bi, ci, di;
  string tes;
  getline(cin, tes);
  ai = tes.length() - 2;
  getline(cin, tes);
  bi = tes.length() - 2;
  getline(cin, tes);
  ci = tes.length() - 2;
  getline(cin, tes);
  di = tes.length() - 2;
  int count = 0;
  bool ab, bb, cb, db;
  ab = great(ai, bi, ci, di);
  if (ab) count++;
  bb = great(bi, ai, ci, di);
  if (bb) count++;
  cb = great(ci, ai, bi, di);
  if (cb) count++;
  db = great(di, ai, bi, ci);
  if (db) count++;
  if (count == 1) {
    if (ab)
      cout << "A" << endl;
    else if (bb)
      cout << "B" << endl;
    else if (cb)
      cout << "C" << endl;
    else
      cout << "D" << endl;
  } else
    cout << "C" << endl;
  return 0;
}
