#include <bits/stdc++.h>
using namespace std;
int main() {
  int ar[4];
  string s;
  for (int i = 0; i < (4); i++) {
    cin >> s;
    ar[i] = s.length() - 2;
  }
  string res = "ABCD";
  char small = 'n', large = 'n';
  int cnt = 0, len;
  for (int i = 0; i < 4; i++) {
    cnt = 0;
    len = ar[i];
    for (int j = 0; j < 4; j++) {
      if (i == j) continue;
      if (2 * ar[j] <= len) cnt++;
      if (2 * len <= ar[j]) cnt--;
    }
    if (cnt == 3) {
      large = (char)res[i];
    }
    if (cnt == -3) {
      small = (char)res[i];
    }
  }
  if (small == 'n' && large != 'n')
    cout << large << endl;
  else if (large == 'n' && small != 'n')
    cout << small << endl;
  else
    cout << "C" << endl;
  return 0;
}
