#include <bits/stdc++.h>
using namespace std;
int main() {
  int p = 0;
  char ch = '0', var;
  pair<int, char> sam[4];
  string str[4];
  for (int i = 0; i < 4; i++) {
    cin >> str[i];
    sam[i].first = str[i].size() - 2;
    sam[i].second = (char)65 + i;
  }
  sort(sam, sam + 4);
  if (sam[0].first <= sam[1].first / 2) {
    var = sam[0].second;
    p++;
  }
  if (sam[3].first >= sam[2].first * 2) {
    var = sam[3].second;
    p++;
  }
  if (p == 2 or p == 0)
    cout << 'C';
  else
    cout << var;
}
