#include <bits/stdc++.h>
using namespace std;
int main() {
  char option[4][105], ans;
  int i, min1, max1, min2, max2, minlen, maxlen, length[4], flag = 0;
  for (i = 0; i < 4; i++) {
    cin >> option[i];
    length[i] = strlen(option[i]) - 2;
  }
  minlen = length[0];
  min1 = 0;
  maxlen = length[0];
  max1 = 0;
  for (i = 1; i < 4; i++) {
    if (maxlen < length[i]) {
      maxlen = length[i];
      max1 = i;
    }
    if (minlen > length[i]) {
      minlen = length[i];
      min1 = i;
    }
  }
  maxlen = 0;
  minlen = 101;
  for (i = 0; i < 4; i++) {
    if (maxlen < length[i] && i != max1) {
      maxlen = length[i];
      max2 = i;
    }
    if (minlen > length[i] && i != min1) {
      minlen = length[i];
      min2 = i;
    }
  }
  if (2 * length[min1] <= length[min2]) {
    ans = option[min1][0];
    flag++;
  }
  if (length[max1] >= 2 * length[max2]) {
    ans = option[max1][0];
    flag++;
  }
  if (flag == 1)
    cout << ans;
  else
    cout << "C";
  return 0;
}
