#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  std::cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int fx[] = {+1, -1, +0, +0};
const int fy[] = {+0, +0, +1, -1};
void solve() {
  string s[4];
  for (long long int i = 0; i < 4; ++i) {
    cin >> s[i];
  }
  long long int a[4];
  for (long long int i = 0; i < 4; ++i) {
    a[i] = s[i].length() - 2;
  }
  long long int ii, in;
  ii = (max_element(a, a + 4) - a);
  in = (min_element(a, a + 4) - a);
  long long int f = 1, f1 = 1;
  for (long long int i = 0; i < 4; ++i) {
    if (a[ii] / 2 < a[i] && ii != i) {
      f = 0;
    }
  }
  for (long long int i = 0; i < 4; ++i) {
    if (a[in] * 2 > a[i] && in != i) {
      f1 = 0;
    }
  }
  if (f && f1)
    cout << "C";
  else if (!f && !f1)
    cout << "C";
  else if (f)
    cout << char('A' + ii);
  else
    cout << char('A' + in);
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) solve();
  return 0;
  return 0;
}
