#include <bits/stdc++.h>
using namespace std;
int main() {
  int small = 1000, big = 0, k, x, y, z;
  char ch = 'C', chs, chl;
  bool bol1 = false, bol2 = false;
  string a, b, c, d;
  cin >> a >> b >> c >> d;
  k = a.size() - 2;
  x = b.size() - 2;
  y = c.size() - 2;
  z = d.size() - 2;
  if (k < x && k < y && k < z) {
    small = k;
    k = k * 2 + 2;
    chs = 'A';
  } else if (x < k && x < y && x < z) {
    small = x;
    x = x * 2 + 2;
    chs = 'B';
  } else if (y < x && y < k && y < z) {
    small = y;
    y = y * 2 + 2;
    chs = 'C';
  } else if (z < x && z < y && z < k) {
    small = z;
    z = z * 2 + 2;
    chs = 'D';
  }
  if (small * 2 <= k && small * 2 <= x && small * 2 <= y && small * 2 <= z) {
    bol1 = true;
  }
  k = a.size() - 2;
  x = b.size() - 2;
  y = c.size() - 2;
  z = d.size() - 2;
  if (k > x && k > y && k > z) {
    big = k;
    k = 0;
    chl = 'A';
  } else if (x > k && x > y && x > z) {
    big = x;
    x = 0;
    chl = 'B';
  } else if (y > x && y > k && y > z) {
    big = y;
    y = 0;
    chl = 'C';
  } else if (z > x && z > y && z > k) {
    big = z;
    z = 0;
    chl = 'D';
  }
  big /= 2;
  if ((big >= k) && (big >= x) && (big >= y) && (big >= z)) {
    bol2 = true;
  }
  if ((bol1 == true && bol2 == true) || (bol1 == false && bol2 == false)) {
    ch = 'C';
    cout << ch;
  } else if (bol1)
    cout << chs;
  else
    cout << chl << endl;
}
