#include <bits/stdc++.h>
using namespace std;
struct my {
  int x;
  char ch;
};
bool operator<(my ob1, my ob2) { return ob1.x < ob2.x; }
int main() {
  my choices[4];
  string s;
  int i;
  for (i = 0; i < 4; i++) {
    cin >> s;
    choices[i].x = s.size() - 2;
    choices[i].ch = s[0];
  }
  sort(choices, choices + 4);
  if (2 * choices[0].x <= choices[1].x || choices[3].x >= 2 * choices[2].x) {
    if (!(2 * choices[0].x <= choices[1].x)) {
      cout << choices[3].ch << endl;
      return 0;
    }
    if (!(choices[3].x >= 2 * choices[2].x)) {
      cout << choices[0].ch << endl;
      return 0;
    }
  }
  cout << 'C' << endl;
  return 0;
}
