#include <bits/stdc++.h>
using namespace std;
long long f(long long n) {
  long long res = 0;
  while (n) {
    if (n % 10 != 0) {
      res = res * 10 + (n % 10);
    }
    n /= 10;
  }
  long long rev = 0;
  while (res) {
    rev = (rev * 10) + (res % 10);
    res /= 10;
  }
  return rev;
}
int32_t main() {
  string s[4];
  for (long long i = 0; i < 4; i++) cin >> s[i];
  long long f[4] = {};
  for (long long i = 0; i < 4; i++) {
    f[i] = s[i].length() - 2;
  }
  long long mx = 0, mn = 106;
  char big, small;
  for (long long i = 0; i < 4; i++) {
    if (mx < f[i]) {
      mx = f[i];
      big = (char)(i + 'A');
    }
    if (mn > f[i]) {
      mn = f[i];
      small = (char)(i + 'A');
    }
  }
  bool isbig = true, issmall = true;
  for (char c = 'A'; c <= 'D'; c++) {
    if (f[c - 'A'] * 2 > f[big - 'A'] && c != big) {
      isbig = false;
    }
    if (f[c - 'A'] < f[small - 'A'] * 2 && c != small) {
      issmall = false;
    }
  }
  if ((isbig ^ issmall) == 0) {
    cout << "C";
  } else if (isbig == true) {
    cout << big;
  } else
    cout << small;
}
