#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3, s4;
  cin >> s1 >> s2 >> s3 >> s4;
  int a = s1.length() - 2;
  int b = s2.length() - 2;
  int c = s3.length() - 2;
  int d = s4.length() - 2;
  int count = 0;
  char ans;
  if (2 * a <= b && 2 * a <= c && 2 * a <= d) {
    ans = 'A';
    count++;
  }
  if (2 * b <= a && 2 * b <= c && 2 * b <= d) {
    ans = 'B';
    count++;
  }
  if (2 * c <= a && 2 * c <= b && 2 * c <= d) {
    ans = 'C';
    count++;
  }
  if (2 * d <= a && 2 * d <= b && 2 * d <= c) {
    ans = 'D';
    count++;
  }
  if (a >= 2 * b && a >= 2 * c && a >= 2 * d) {
    ans = 'A';
    count++;
  }
  if (b >= 2 * a && b >= 2 * c && b >= 2 * d) {
    ans = 'B';
    count++;
  }
  if (c >= 2 * a && c >= 2 * b && c >= 2 * d) {
    ans = 'C';
    count++;
  }
  if (d >= 2 * a && d >= 2 * b && d >= 2 * c) {
    count++;
    ans = 'D';
  }
  if (count == 1)
    cout << ans;
  else
    cout << 'C';
  return 0;
}
