#include <bits/stdc++.h>
using namespace std;
int main() {
  int meow, k = 0;
  string s[4];
  for (int i = 0; i < 4; i++) cin >> s[i];
  for (int i = 0; i < 4; i++) {
    int n1 = 0, n2 = 0;
    for (int j = 0; j < 4; j++) {
      if (j == i) continue;
      n1 += (((s[i].size() - 2) * 2) <= (s[j].size() - 2));
      n2 += ((s[i].size() - 2) >= ((s[j].size() - 2) * 2));
    }
    if (n1 == 3 || n2 == 3) {
      meow = i;
      k++;
    }
  }
  if (k == 1)
    cout << s[meow][0] << endl;
  else
    cout << "C" << endl;
  return 0;
}
