#include <bits/stdc++.h>
using namespace std;
const int N = 300000;
bool used[5];
bool check(int k1, int k2, int k3, int k4) {
  if (k1 >= 2 * k2 && k1 >= 2 * k3 && k1 >= 2 * k4) return true;
  if (2 * k1 <= k2 && 2 * k1 <= k3 && 2 * k1 <= k4) return true;
  return false;
}
int main() {
  string s1, s2, s3, s4;
  cin >> s1;
  scanf("\n");
  cin >> s2;
  scanf("\n");
  cin >> s3;
  scanf("\n");
  cin >> s4;
  scanf("\n");
  int k1 = s1.length() - 2, k2 = s2.length() - 2, k3 = s3.length() - 2,
      k4 = s4.length() - 2;
  memset(used, false, sizeof(used));
  if (check(k1, k2, k3, k4)) used[1] = true;
  if (check(k2, k1, k3, k4)) used[2] = true;
  if (check(k3, k1, k2, k4)) used[3] = true;
  if (check(k4, k1, k2, k3)) used[4] = true;
  char ans = 'C';
  int k = 0;
  for (int i = 1; i <= 4; i++)
    if (used[i]) k++;
  if (k == 1) {
    if (used[1]) ans = 'A';
    if (used[2]) ans = 'B';
    if (used[4]) ans = 'D';
  }
  cout << ans;
  return 0;
}
