#include <bits/stdc++.h>
using namespace std;
void online_judge() {}
const int N = 2e5 + 5;
int small = INT_MIN;
int large = INT_MAX;
void solve() {
  string s1, s2, s3, s4;
  cin >> s1 >> s2 >> s3 >> s4;
  vector<pair<int, char>> a;
  a.push_back(make_pair(s1.size() - 2, 'A'));
  a.push_back(make_pair(s2.size() - 2, 'B'));
  a.push_back(make_pair(s3.size() - 2, 'C'));
  a.push_back(make_pair(s4.size() - 2, 'D'));
  sort(a.begin(), a.end());
  bool ans1, ans2;
  ans1 = ans2 = false;
  if (a[0].first * 2 <= a[1].first) {
    ans1 = true;
  }
  if (a[2].first * 2 <= a[3].first) {
    ans2 = true;
  }
  if ((ans1 && ans2) || (!ans1 && !ans2)) {
    cout << 'C';
  } else if (ans1) {
    cout << a[0].second;
  } else {
    cout << a[3].second;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  online_judge();
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
