#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string &, char);
vector<string> &split(const string &, char, vector<string> &);
bool compare(int, int);
int main() {
  vector<int> length, sorting;
  vector<string>::iterator it;
  vector<int>::iterator init;
  int i, decide = 0;
  string test;
  for (i = 0; i < 4; i++) {
    getline(cin, test);
    vector<string> tmp = split(test, '.');
    it = tmp.begin() + 1;
    length.push_back((*it).size());
    sorting.push_back((*it).size());
  }
  sort(sorting.begin(), sorting.begin() + 4, compare);
  if (((*(sorting.begin() + 1)) * 2 <= *(sorting.begin())) &&
      ((*(sorting.begin() + 2)) < *(sorting.begin() + 3) * 2)) {
    for (decide = 0, init = length.begin(); init != length.end();
         init++, decide++) {
      if (*(init) == *(sorting.begin())) {
        cout << (char)(65 + decide);
      }
    }
  } else if (((*(sorting.begin() + 2)) >= *(sorting.begin() + 3) * 2) &&
             ((*(sorting.begin() + 1)) * 2 > *(sorting.begin()))) {
    for (decide = 0, init = length.begin(); init != length.end();
         init++, decide++) {
      if (*(init) == *(sorting.begin() + 3)) {
        cout << (char)(65 + decide);
      }
    }
  } else {
    cout << "C";
  }
}
vector<string> split(const string &s, char delim) {
  vector<string> elems;
  split(s, delim, elems);
  return elems;
}
vector<string> &split(const string &s, char delim, vector<string> &elems) {
  stringstream ss(s);
  string item;
  while (getline(ss, item, delim)) {
    elems.push_back(item);
  }
  return elems;
}
bool compare(int a, int b) { return a > b; }
