#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int a[4];
  for (int i = 0; i < 4; i++) {
    cin >> s;
    a[i] = s.length() - 2;
  }
  vector<int> res;
  char ans[] = {'A', 'B', 'C', 'D'};
  int k = 3;
  while (k >= 0) {
    bool op1 = true, op2 = true;
    for (int i = 0; i < 4; i++) {
      if (i != k) {
        if (a[k] * 2 <= a[i])
          continue;
        else {
          op1 = false;
          break;
        }
      }
    }
    if (op1) res.push_back(k);
    for (int i = 0; i < 4; i++) {
      if (i != k) {
        if (a[k] >= 2 * a[i])
          continue;
        else {
          op2 = false;
          break;
        }
      }
    }
    if (op2) res.push_back(k);
    k--;
  }
  if (res.size() == 1)
    cout << ans[res.front()] << endl;
  else
    cout << ans[2] << endl;
  return 0;
}
