#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c, d;
  bool f = 0, g = 0;
  cin >> a >> b >> c >> d;
  pair<int, char> m[4];
  m[0].first = a.length() - 2;
  m[0].second = 'A';
  m[1].first = b.length() - 2;
  m[1].second = 'B';
  m[2].first = c.length() - 2;
  m[2].second = 'C';
  m[3].first = d.length() - 2;
  m[3].second = 'D';
  sort(m, m + 4);
  if (m[0].first <= m[1].first / 2.0) f = true;
  if (m[3].first >= m[2].first * 2) g = true;
  if (f && g || (!f && !g))
    cout << "C";
  else if (f)
    cout << m[0].second;
  else if (g)
    cout << m[3].second;
  return 0;
}
