#include <bits/stdc++.h>
using namespace std;
int main() {
  char out;
  string s1, s2, s3, s4;
  cin >> s1 >> s2 >> s3 >> s4;
  string s11 = s1.substr(2);
  string s12 = s2.substr(2);
  string s13 = s3.substr(2);
  string s14 = s4.substr(2);
  int l1 = s11.length();
  int l2 = s12.length();
  int l3 = s13.length();
  int l4 = s14.length();
  out = NULL;
  if ((l2 / l1 >= 2 && l3 / l1 >= 2 && l4 / l1 >= 2) ||
      (l1 / l2 >= 2 && l1 / l3 >= 2 && l1 / l4 >= 2))
    out = 'A';
  if ((l1 / l2 >= 2 && l3 / l2 >= 2 && l4 / l2 >= 2) ||
      (l2 / l1 >= 2 && l2 / l3 >= 2 && l2 / l4 >= 2)) {
    if (out == NULL)
      out = 'B';
    else {
      cout << "C";
      return 0;
    }
  }
  if ((l1 / l3 >= 2 && l2 / l3 >= 2 && l4 / l3 >= 2) ||
      (l3 / l1 >= 2 && l3 / l2 >= 2 && l3 / l4 >= 2))
    out = 'C';
  if ((l1 / l4 >= 2 && l2 / l4 >= 2 && l3 / l4 >= 2) ||
      (l4 / l1 >= 2 && l4 / l2 >= 2 && l4 / l3 >= 2)) {
    if (out == NULL)
      out = 'D';
    else {
      cout << "C";
      return 0;
    }
  }
  if (out == NULL)
    cout << "C";
  else
    cout << out;
}
