#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  vector<string> v(4);
  vector<char> X;
  for (int i = 0; i < 4; i++) {
    cin >> v[i];
  }
  int c, j, i, k;
  bool f = false;
  for (i = 0; i < 4; i++) {
    c = 0;
    k = 0;
    for (j = 0; j < 4; j++) {
      if (i != j) {
        if ((v[i].size() - 2) * 2 <= (v[j].size() - 2)) {
          c++;
        }
        if ((v[i].size() - 2) >= (v[j].size() - 2) * 2) {
          k++;
        }
      }
    }
    if (c == 3 || k == 3) {
      X.push_back('A' + i);
      f = true;
    }
  }
  if (!f || X.size() > 1)
    cout << "C" << endl;
  else
    cout << X[0] << endl;
  return 0;
}
