#include <bits/stdc++.h>
using namespace std;
bool compare(pair<string, long long> p, pair<string, long long> q) {
  return p.second > q.second;
}
bool mcompare(pair<string, long long> p, pair<string, long long> q) {
  return p.second < q.second;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string c1, c2, c3, c4;
  cin >> c1 >> c2 >> c3 >> c4;
  vector<pair<string, long long>> v;
  v.push_back({c1, c1.length() - 2});
  v.push_back({c2, c2.length() - 2});
  v.push_back({c3, c3.length() - 2});
  v.push_back({c4, c4.length() - 2});
  sort(v.begin(), v.end(), compare);
  long long max = v[0].second;
  long long count = 0;
  for (long long i = 0; i < v.size(); i++) {
    if (v[i].second == max) count++;
  }
  string ans = "C";
  long long grc = 0;
  if (count == 1 && v[0].second >= v[1].second * 2) {
    if (v[0].first == c1)
      ans = "A";
    else if (v[0].first == c2)
      ans = "B";
    else if (v[0].first == c3)
      ans = "C";
    else
      ans = "D";
    grc++;
  }
  long long cnt = 0;
  sort(v.begin(), v.end(), mcompare);
  long long min = v[0].second;
  for (long long i = 0; i < v.size(); i++)
    if (v[i].second == min) cnt++;
  if (cnt == 1 && v[0].second * 2 <= v[1].second) {
    if (v[0].first == c1)
      ans = "A";
    else if (v[0].first == c2)
      ans = "B";
    else if (v[0].first == c3)
      ans = "C";
    else
      ans = "D";
    grc++;
  }
  if (grc > 1)
    cout << "C" << endl;
  else
    cout << ans << endl;
}
