#include <bits/stdc++.h>
using namespace std;
int main() {
  char a;
  int k = 0;
  string A, B, C, D;
  cin >> A >> B >> C >> D;
  int aa, bb, cc, dd;
  aa = A.length() - 2;
  bb = B.length() - 2;
  cc = C.length() - 2;
  dd = D.length() - 2;
  if ((2 * aa <= bb && 2 * aa <= cc && 2 * aa <= dd) ||
      (aa >= 2 * bb && aa >= 2 * cc && aa >= 2 * dd)) {
    a = 'A';
    k++;
  }
  if ((2 * bb <= aa && 2 * bb <= cc && 2 * bb <= dd) ||
      (bb >= 2 * aa && bb >= 2 * cc && bb >= 2 * dd)) {
    a = 'B';
    k++;
  }
  if ((2 * cc <= aa && 2 * cc <= bb && 2 * cc <= dd) ||
      (cc >= 2 * aa && cc >= 2 * bb && cc >= 2 * dd)) {
    a = 'C';
    k++;
  }
  if ((2 * dd <= aa && 2 * dd <= bb && 2 * dd <= cc) ||
      (dd >= 2 * aa && dd >= 2 * bb && dd >= 2 * cc)) {
    a = 'D';
    k++;
  }
  if (k == 1)
    cout << a << endl;
  else
    cout << 'C' << endl;
}
