#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[4], tmp = 0, i, j, k;
  string s;
  bool b1, b2;
  for (i = 0; i < 4; i++) {
    cin >> s;
    a[i] = s.length() - 2;
  }
  for (i = 0; i < 4; ++i) {
    b1 = true;
    b2 = true;
    for (j = 0; j < 4; ++j) {
      if (j != i) {
        if (2 * a[i] > a[j]) b1 = false;
        if (a[i] < 2 * a[j]) b2 = false;
      }
    }
    if (b1 || b2) {
      tmp++;
      k = i;
    }
  }
  if (tmp == 1)
    cout << (char)('A' + k) << '\n';
  else
    cout << (char)'C' << '\n';
  return 0;
}
