#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<pair<int, char> > nb(4);
  for (auto &i : nb) {
    string a;
    cin >> a;
    i.first = a.size() - 2;
    i.second = a[0];
  }
  sort(nb.begin(), nb.end());
  int ax(0);
  int ax1(0);
  for (int i = 1; i < 4; ++i) {
    if (nb[0].first * 2 <= nb[i].first) ++ax;
  }
  for (int i = 2; i >= 0; --i) {
    if (nb[3].first >= nb[i].first * 2) ++ax1;
  }
  if (ax == ax1 || ax < 3 && ax1 < 3) {
    cout << 'C';
    return 0;
  }
  if (ax == 3) {
    cout << nb[0].second;
    return 0;
  }
  cout << nb[3].second;
}
