#include <bits/stdc++.h>
using namespace std;
vector<pair<int, char> > yara;
string x;
bool WE, LOVE = false;
int main() {
  for (int i = 0; i < 4; i++) {
    cin >> x;
    yara.push_back(make_pair(x.size() - 2, x[0]));
  }
  sort(yara.begin(), yara.end());
  if (2 * yara[0].first <= yara[1].first) {
    WE = true;
  }
  if (yara[3].first >= yara[2].first * 2) {
    LOVE = true;
  }
  if (WE && LOVE)
    cout << "C\n";
  else if (!WE && !LOVE)
    cout << "C\n";
  else if (LOVE) {
    cout << yara[3].second << endl;
  } else
    cout << yara[0].second << endl;
  return 0;
}
