#include <bits/stdc++.h>
using namespace std;
long long m, n, i, j, k, d, x, a, b;
string s[4];
vector<long long> v;
int main() {
  cin >> s[0] >> s[1] >> s[2] >> s[3];
  for (i = 0; i < 4; i++) {
    m = 0;
    n = 0;
    for (j = 0; j < 4; j++) {
      if (i != j) {
        if ((s[i].size() - 2) >= 2 * (s[j].size() - 2)) {
          m++;
        } else if (2 * (s[i].size() - 2) <= (s[j].size() - 2)) {
          n++;
        }
      }
    }
    if (m == 3 || n == 3) {
      x = i;
      a++;
    }
  }
  if (a == 1)
    cout << char(x + 'A') << endl;
  else
    cout << 'C' << endl;
}
