#include <bits/stdc++.h>
using namespace std;
int main() {
  string a[4];
  for (int i = 0; i < 4; i++) cin >> a[i];
  int l[4];
  for (int i = 0; i < 4; i++) l[i] = a[i].length() - 2;
  char c;
  int sum = 0;
  for (int i = 0; i < 4; i++) {
    int sumshort = 0, sumtall = 0;
    for (int j = 0; j < 4; j++) {
      if (j != i) {
        if (l[i] * 2 <= l[j]) sumshort++;
        if (l[i] >= l[j] * 2) sumtall++;
      }
    }
    if (sumshort == 3 && sumtall == 0) {
      c = a[i][0];
      sum++;
    }
    if (sumtall == 3 && sumshort == 0) {
      c = a[i][0];
      sum++;
    }
  }
  if (sum == 1)
    cout << c << endl;
  else
    cout << "C" << endl;
  return 0;
}
