#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k;
  string s[4];
  for (i = 0; i < 4; i++) cin >> s[i];
  int sizes[4];
  for (i = 0; i < 4; i++) sizes[i] = s[i].size() - 2;
  sort(sizes, sizes + 4);
  if (sizes[0] <= 0.5 * sizes[1] && sizes[3] < 2 * sizes[2]) {
    for (i = 0; i < 4; i++) {
      if (s[i].size() - 2 == sizes[0]) cout << s[i][0];
    }
  } else if (sizes[3] >= 2 * sizes[2] && sizes[0] > 0.5 * sizes[1]) {
    for (i = 0; i < 4; i++) {
      if (s[i].size() - 2 == sizes[3]) cout << s[i][0];
    }
  } else
    cout << "C";
}
