#include <bits/stdc++.h>
using namespace std;
ifstream fin("T.txt");
int main(int argc, char *argv[]) {
  string a;
  int x[4];
  for (int i = 0; i < 4; i++) {
    cin >> a;
    x[i] = a.size() - 2;
  }
  int max = 0, min = 0, l, f;
  for (int i = 0; i < 4; i++) {
    int t = 0, k = 0;
    for (int j = 0; j < 4; j++) {
      if (i != j && x[i] >= 2 * x[j]) t++;
      if (i != j && x[i] <= x[j] / 2) k++;
    }
    if (t == 3) {
      max++;
      l = i;
    }
    if (k == 3) {
      min++;
      f = i;
    }
  }
  int b = 0;
  if (min == 1 && max == 0) {
    cout << char(65 + f);
    b = 1;
  }
  if (min == 0 && max == 1) {
    cout << char(65 + l);
    b = 1;
  }
  if (b == 0) cout << "C";
  return 0;
}
