#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  pair<int, string> p[4];
  for (int i = 0; i < 4; i++) {
    cin >> s;
    p[i] = make_pair(s.length() - 2, s);
  }
  sort(p, p + 4);
  int b = -1;
  if (p[1].first / 2 >= p[0].first) b = 0;
  if (p[3].first / 2 >= p[2].first) {
    if (b == 0)
      b = -1;
    else
      b = 3;
  }
  if (b == -1)
    cout << "C";
  else
    cout << p[b].second[0];
  return 0;
}
