#include <bits/stdc++.h>
using namespace std;
bool IsGreat(int i, int l[]) {
  bool flag = true;
  for (int j = 0; j < 4; j++)
    if (j != i && 2 * l[i] > l[j]) flag = false;
  if (flag == true) return true;
  flag = true;
  for (int j = 0; j < 4; j++)
    if (j != i && 2 * l[j] > l[i]) flag = false;
  return flag;
}
int main() {
  int length[4];
  for (int i = 0; i < 4; i++) {
    string temp;
    cin >> temp;
    length[i] = temp.length() - 2;
  }
  vector<int> great;
  for (int i = 0; i < 4; i++) {
    if (IsGreat(i, length)) great.push_back(i);
  }
  if (great.size() == 1)
    printf("%c\n", 'A' + great[0]);
  else
    cout << 'C' << endl;
  return 0;
}
