#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c, d;
  cin >> a >> b >> c >> d;
  int first = a.size() - 2;
  int second = b.size() - 2;
  int z = c.size() - 2;
  int w = d.size() - 2;
  int n = 0, m = 0;
  if ((first <= second / 2) && (first <= z / 2) && (first <= w / 2)) {
    ++n;
    a = "";
  }
  if ((second <= first / 2) && (second <= z / 2) && (second <= w / 2)) {
    ++n;
    b = "";
  }
  if ((z <= second / 2) && (z <= first / 2) && (z <= w / 2)) {
    ++n;
    c = "";
  }
  if ((w <= second / 2) && (w <= z / 2) && (w <= first / 2)) {
    ++n;
    d = "";
  }
  if ((first >= second * 2) && (first >= z * 2) && (first >= w * 2)) {
    ++n;
    a = "";
  }
  if ((second >= first * 2) && (second >= z * 2) && (second >= w * 2)) {
    ++n;
    b = "";
  }
  if ((z >= second * 2) && (z >= first * 2) && (z >= w * 2)) {
    ++n;
    c = "";
  }
  if ((w >= second * 2) && (w >= z * 2) && (w >= first * 2)) {
    ++n;
    d = "";
  }
  if (n == 1) {
    if (a == "") cout << 'A';
    if (b == "") cout << 'B';
    if (c == "") cout << 'C';
    if (d == "") cout << 'D';
  } else
    cout << 'C';
}
