#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3, s4;
  cin >> s1 >> s2 >> s3 >> s4;
  int a[4] = {0, 0, 0, 0};
  int l1 = s1.length() - 2;
  int l2 = s2.length() - 2;
  int l3 = s3.length() - 2;
  int l4 = s4.length() - 2;
  if (l1 >= 2 * l2 && l1 >= 2 * l3 && l1 >= 2 * l4)
    a[0]++;
  else if (2 * l1 <= l2 && 2 * l1 <= l3 && 2 * l1 <= l4)
    a[0]++;
  if (l2 >= 2 * l1 && l2 >= 2 * l3 && l2 >= 2 * l4)
    a[1]++;
  else if (2 * l2 <= l1 && 2 * l2 <= l3 && 2 * l2 <= l4)
    a[1]++;
  if (l4 >= 2 * l1 && l4 >= 2 * l2 && l4 >= 2 * l3)
    a[3]++;
  else if (2 * l4 <= l1 && 2 * l4 <= l2 && 2 * l4 <= l3)
    a[3]++;
  if (l3 >= 2 * l1 && l3 >= 2 * l2 && l3 >= 2 * l4)
    a[2]++;
  else if (2 * l3 <= l1 && 2 * l3 <= l2 && 2 * l3 <= l4)
    a[2]++;
  int count1 = 0;
  for (int i = 0; i < 4; i++) {
    if (a[i] == 1) count1++;
  }
  if (count1 != 1)
    cout << "C";
  else {
    if (a[0] == 1)
      cout << "A";
    else if (a[1] == 1)
      cout << "B";
    else if (a[2] == 1)
      cout << "C";
    else
      cout << "D";
  }
}
