#include <bits/stdc++.h>
using namespace std;
vector<pair<int, char> > V;
map<char, int> A;
int main() {
  string x;
  cin >> x;
  V.push_back(make_pair(x.size() - 2, 'A'));
  cin >> x;
  V.push_back(make_pair(x.size() - 2, 'B'));
  cin >> x;
  V.push_back(make_pair(x.size() - 2, 'C'));
  cin >> x;
  V.push_back(make_pair(x.size() - 2, 'D'));
  int l = 0;
  sort(V.begin(), V.end());
  if (V[3].first >= V[2].first * 2) l++;
  if (V[0].first * 2 <= V[1].first) l += 2;
  if (l == 1)
    cout << V[3].second;
  else if (l == 2)
    cout << V[0].second;
  else
    cout << 'C';
  return 0;
}
