#include <bits/stdc++.h>
using namespace std;
int main() {
  pair<int, char> pa[100];
  string input;
  int c[2];
  char the_choice1, the_choice2;
  for (int i = 0; i < 4; i++) {
    cin >> input;
    pa[i].first = (input.size() - 2);
    pa[i].second = input[0];
  }
  sort(pa, pa + 4);
  for (int i = 0; i < 4; i++) {
    if (i == 0) {
      reverse(pa, pa + 4);
      c[0] = pa[i].first / 2;
      the_choice1 = pa[i].second;
    } else if (c[0] < pa[i].first) {
      c[0] = 0;
      break;
    }
  }
  reverse(pa, pa + 4);
  for (int i = 0; i < 4; i++) {
    if (i == 0) {
      c[1] = pa[i].first;
      the_choice2 = pa[i].second;
    } else if (c[1] > (pa[i].first / 2)) {
      c[1] = 0;
      break;
    }
  }
  if ((!c[0] && !c[1]) || ((c[0] && c[1])))
    cout << "C" << endl;
  else if (c[0])
    cout << the_choice1 << endl;
  else
    cout << the_choice2 << endl;
  return 0;
}
