#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c, d;
  cin >> a >> b >> c >> d;
  int as, bs, cs, ds;
  as = a.size() - 2;
  bs = b.size() - 2;
  cs = c.size() - 2;
  ds = d.size() - 2;
  int ba, bb, bc, bd;
  ba = 0;
  bb = 0;
  bc = 0;
  bd = 0;
  if ((as >= bs * 2 && as >= cs * 2 && as >= ds * 2) ||
      (as <= bs / 2 && as <= cs / 2 && as <= ds / 2))
    ba = 1;
  if ((bs >= as * 2 && bs >= cs * 2 && bs >= ds * 2) ||
      (bs <= as / 2 && bs <= cs / 2 && bs <= ds / 2))
    bb = 1;
  if ((cs >= bs * 2 && cs >= ds * 2 && cs >= as * 2) ||
      (cs <= bs / 2 && cs <= ds / 2 && cs <= as / 2))
    bc = 1;
  if ((ds >= bs * 2 && ds >= cs * 2 && ds >= as * 2) ||
      (ds <= bs / 2 && ds <= cs / 2 && ds <= as / 2))
    bd = 1;
  if (ba + bb + bd + bc != 1 || (ba + bb + bc + bd == 1 && bc == 1)) {
    cout << "C";
    return 0;
  } else if (ba == 1)
    cout << "A";
  else if (bb == 1)
    cout << "B";
  else if (bd == 1)
    cout << "D";
  return 0;
}
