#include <bits/stdc++.h>
using namespace std;
bool check[4];
long long cnt[4];
int main() {
  string A, B, C, D;
  cin >> A >> B >> C >> D;
  cnt[0] = A.length() - 2;
  cnt[1] = B.length() - 2;
  cnt[2] = C.length() - 2;
  cnt[3] = D.length() - 2;
  for (long long i = 0; i < 4; i++) {
    check[i] = false;
  }
  if ((cnt[0] >= 2 * cnt[1] && cnt[0] >= 2 * cnt[2] && cnt[0] >= 2 * cnt[3]) ||
      (cnt[0] <= cnt[1] / 2 && cnt[0] <= cnt[2] / 2 && cnt[0] <= cnt[3] / 2))
    check[0] = true;
  if ((cnt[1] >= 2 * cnt[0] && cnt[1] >= 2 * cnt[2] && cnt[1] >= 2 * cnt[3]) ||
      (cnt[1] <= cnt[0] / 2 && cnt[1] <= cnt[2] / 2 && cnt[1] <= cnt[3] / 2))
    check[1] = true;
  if ((cnt[2] >= 2 * cnt[1] && cnt[2] >= 2 * cnt[0] && cnt[2] >= 2 * cnt[3]) ||
      (cnt[2] <= cnt[1] / 2 && cnt[2] <= cnt[0] / 2 && cnt[2] <= cnt[3] / 2))
    check[2] = true;
  if ((cnt[3] >= 2 * cnt[1] && cnt[3] >= 2 * cnt[2] && cnt[3] >= 2 * cnt[0]) ||
      (cnt[3] <= cnt[1] / 2 && cnt[3] <= cnt[2] / 2 && cnt[3] <= cnt[0] / 2))
    check[3] = true;
  long long cnttr = 0;
  for (long long i = 0; i < 4; i++) {
    if (check[i]) cnttr++;
  }
  if (cnttr == 1) {
    for (long long i = 0; i < 4; i++) {
      if (check[i]) {
        if (i == 0) cout << "A" << endl;
        if (i == 1) cout << "B" << endl;
        if (i == 2) cout << "C" << endl;
        if (i == 3) cout << "D" << endl;
      }
    }
  } else
    cout << "C" << endl;
  return 0;
}
