#include <bits/stdc++.h>
using namespace std;
string ss[200];
int main() {
  pair<int, char> p[200];
  for (int i = 1; i <= 4; i++) {
    cin >> ss[i];
    p[i].first = ss[i].size() - 2;
    p[i].second = char(i + 64);
  }
  sort(p + 1, p + 5);
  if (p[1].first * 2 <= p[2].first && p[3].first * 2 > p[4].first)
    cout << p[1].second << endl;
  else if (p[3].first * 2 <= p[4].first && p[1].first * 2 > p[2].first) {
    cout << p[4].second << endl;
  } else
    cout << 'C' << endl;
}
