#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[4];
  pair<int, int> max, min;
  int l[4];
  for (__typeof(4) i = 0; i < 4; i++) {
    cin >> s[i];
    l[i] = s[i].length() - 2;
  }
  for (__typeof(4) i = 0; i < 4; i++) {
    if (i == 0) {
      max.first = min.first = 0;
      max.second = min.second = l[i];
    }
    if (l[i] > max.second) {
      max.first = i;
      max.second = l[i];
    }
    if (l[i] < min.second) {
      min.first = i;
      min.second = l[i];
    }
  }
  int flagMax = 0;
  int flagMin = 0;
  for (__typeof(4) i = 0; i < 4; i++) {
    if (i != max.first && l[i] * 2 <= max.second) {
      flagMax++;
    }
    if (i != min.first && l[i] >= min.second * 2) {
      flagMin++;
    }
  }
  if (flagMax == 3) {
    if (flagMin == 3)
      cout << "C";
    else
      cout << (char)('A' + max.first);
  } else if (flagMin == 3)
    cout << (char)('A' + min.first);
  else
    cout << "C";
}
