#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c, d;
  cin >> a >> b >> c >> d;
  char ans = '*';
  int la = a.length() - 2, lb = b.length() - 2, lc = c.length() - 2,
      ld = d.length() - 2;
  if ((la >= 2 * lb && la >= 2 * lc && la >= 2 * ld) ||
      ((la * 2 <= lb && la * 2 <= lc && la * 2 <= ld))) {
    if (ans == '*')
      ans = 'A';
    else
      ans = '#';
  }
  if ((lb >= 2 * la && lb >= 2 * lc && lb >= 2 * ld) ||
      ((lb * 2 <= la && lb * 2 <= lc && lb * 2 <= ld))) {
    if (ans == '*')
      ans = 'B';
    else
      ans = '#';
  }
  if ((lc >= 2 * lb && lc >= 2 * la && lc >= 2 * ld) ||
      ((lc * 2 <= lb && lc * 2 <= la && lc * 2 <= ld))) {
    if (ans == '*')
      ans = 'C';
    else
      ans = '#';
  }
  if ((ld >= 2 * lb && ld >= 2 * lc && ld >= 2 * la) ||
      ((ld * 2 <= lb && ld * 2 <= lc && ld * 2 <= la))) {
    if (ans == '*')
      ans = 'D';
    else
      ans = '#';
  }
  if (ans != '*' && ans != '#')
    cout << ans << endl;
  else
    cout << 'C' << endl;
  return 0;
}
