#include <bits/stdc++.h>
using namespace std;
bool cmp(string& l, string& r) { return (l.size() < r.size()); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  vector<string> v;
  string s;
  int f1 = 0, f2 = 0;
  for (long long int i = 0; i < 4; i++) {
    cin >> s;
    v.push_back(s);
  }
  sort(v.begin(), v.end(), cmp);
  if ((v[0].size() - 2) * 2 <= v[1].size() - 2) f1 = 1;
  if ((v[3].size() - 2) / 2 >= v[2].size() - 2) f2 = 1;
  if ((f1 && f2) || (!f1 && !f2))
    cout << "C" << endl;
  else if (f1)
    cout << v[0][0] << endl;
  else
    cout << v[3][0] << endl;
}
