#include <bits/stdc++.h>
using namespace std;
bool cp(pair<string, int> p1, pair<string, int> p2) {
  return p1.second > p2.second;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string a[4];
  int t, flg1 = 0, flg2 = 0;
  vector<pair<string, int> > v1;
  for (int i = 0; i < 4; i++) {
    cin >> a[i];
    v1.push_back(make_pair(a[i], a[i].size() - 2));
  }
  sort(v1.begin(), v1.end(), cp);
  for (int i = 0; i < 3; i++) {
    if (v1[0].second / v1[i + 1].second >= 2) {
      t = i;
      flg1++;
    }
    if (v1[i].second / v1[3].second >= 2) {
      flg2++;
      t = i;
    }
  }
  if (flg1 == 3 && flg2 != 3)
    cout << v1[0].first.front();
  else if (flg2 == 3 && flg1 != 3) {
    cout << v1[3].first.front();
  } else {
    cout << 'C';
  }
}
