#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:512000000")
using namespace std;
template <class telem>
telem MAX(telem a, telem b) {
  return (a > b) ? a : b;
}
template <class telem>
telem MIN(telem a, telem b) {
  return (a < b) ? a : b;
}
template <class telem>
telem GCD(telem a, telem b) {
  return b ? GCD(b, a % b) : a;
}
template <class telem>
telem LCM(telem a, telem b) {
  return a / GCD(a, b) * b;
}
template <class telem>
telem UNSIGNED(telem a) {
  return (a > 0) ? a : a * (-1);
}
template <class telem>
void bez_swop(telem &a, telem &b) {
  telem c = a;
  a = b;
  b = c;
}
void swop(int &a, int &b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
}
pair<string, string> s[4];
bool cmp(pair<string, string> a, pair<string, string> b) {
  return a.first.size() < b.first.size();
}
int main() {
  ios_base::sync_with_stdio(false);
  srand(time(NULL));
  time_t start = clock();
  string tmp;
  vector<string> ans;
  for (int i = 0; i < 4; i++) {
    cin >> tmp;
    s[i].first = tmp.substr(2);
    s[i].second = tmp.substr(0, 1);
  }
  sort(s, s + 4, cmp);
  if (2 * s[0].first.size() <= s[1].first.size()) ans.push_back(s[0].second);
  if (s[3].first.size() >= s[2].first.size() * 2) ans.push_back(s[3].second);
  if (ans.size() == 1)
    cout << ans[0];
  else
    cout << 'C';
  return 0;
}
