#include <bits/stdc++.h>
using namespace std;
bool comparator(pair<int, char> p1, pair<int, char> p2) {
  return p1.first < p2.first;
}
int main() {
  string a, b, c, d;
  cin >> a >> b >> c >> d;
  vector<pair<int, char>> v;
  v.push_back(make_pair(a.length() - 2, 'A'));
  v.push_back(make_pair(b.length() - 2, 'B'));
  v.push_back(make_pair(c.length() - 2, 'C'));
  v.push_back(make_pair(d.length() - 2, 'D'));
  sort(v.begin(), v.end(), comparator);
  vector<char> res;
  if ((v[0].first) * 2 <= v[1].first) {
    res.push_back(v[0].second);
  }
  if ((v[3].first) / 2 >= v[2].first) {
    res.push_back(v[3].second);
  }
  if (res.size() == 1) {
    cout << res[0];
  } else {
    cout << "C";
  }
  return 0;
}
