#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3, s4;
  cin >> s1 >> s2 >> s3 >> s4;
  vector<pair<int, char> > a(4);
  a[0].first = s1.size() - 2;
  a[0].second = 'A';
  a[1].first = s2.size() - 2;
  a[1].second = 'B';
  a[2].first = s3.size() - 2;
  a[2].second = 'C';
  a[3].first = s4.size() - 2;
  a[3].second = 'D';
  sort(a.begin(), a.end());
  int n = 0;
  char answer;
  if (a[0].first * 2 <= a[1].first) {
    n++;
    answer = a[0].second;
  }
  if (a[2].first * 2 <= a[3].first) {
    n++;
    answer = a[3].second;
  }
  if (n != 1) {
    cout << "C";
  } else {
    cout << answer;
  }
}
