#include <bits/stdc++.h>
using namespace std;
string s[4];
string ss = "ABCD", ans;
int r = 0, t = 0, n[4], c = 0;
int main() {
  for (int i = 0; i < 4; i++) {
    cin >> s[i];
    n[i] = s[i].size() - 2;
  }
  for (int i = 0; i < 4; i++) {
    r = 0, t = 0;
    for (int j = 0; j < 4; j++) {
      if (i != j) {
        if (n[i] >= 2 * n[j]) r++;
        if (n[i] <= n[j] / 2) t++;
      }
    }
    if (r == 3 || t == 3) {
      c++;
      ans = ss[i];
    }
  }
  if (c == 1)
    cout << ans;
  else
    cout << 'C';
  return 0;
}
