#include <bits/stdc++.h>
using namespace std;
int main() {
  bool smaller = 1, bigger = 1;
  short int small_index = 0, big_index = 0;
  string choices[4];
  cin >> choices[0];
  choices[0].erase(0, 2);
  int biggest = choices[0].size(), smallest = choices[0].size();
  for (int i = 1; i < 4; i++) {
    cin >> choices[i];
    choices[i].erase(0, 2);
    if (choices[i].size() < smallest) {
      smallest = choices[i].size();
      small_index = i;
    }
    if (choices[i].size() > biggest) {
      biggest = choices[i].size();
      big_index = i;
    }
  }
  for (int i = 0; i < 4; i++) {
    if (i == small_index) continue;
    if (smallest > choices[i].size() / 2) {
      smaller = 0;
      break;
    }
  }
  for (int i = 0; i < 4; i++) {
    if (i == big_index) continue;
    if (biggest < choices[i].size() * 2) {
      bigger = 0;
      break;
    }
  }
  if (smaller == 1 && bigger == 0)
    cout << (char)('A' + small_index) << endl;
  else if (smaller == 0 && bigger == 1)
    cout << (char)('A' + big_index) << endl;
  else
    cout << (char)('A' + 2) << endl;
}
