#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<pair<long long int, long long int> > v;
  vector<long long int> gt;
  for (int i = 0; i < 4; i++) {
    string s;
    cin >> s;
    v.push_back({s.size() - 2, i + 1});
  }
  sort(v.begin(), v.end());
  if (v[0].first * 2 <= v[1].first) gt.push_back(v[0].second);
  if (v[2].first * 2 <= v[3].first) gt.push_back(v[3].second);
  if (gt.size() == 1) {
    if (gt[0] == 1)
      cout << 'A' << endl;
    else if (gt[0] == 2)
      cout << 'B' << endl;
    else if (gt[0] == 3)
      cout << 'C' << endl;
    else
      cout << 'D' << endl;
  } else
    cout << 'C' << endl;
  return 0;
}
