#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x3f3f3f3f;
string a, b, c, d;
int n[5];
char tc[5];
int main() {
  std::ios::sync_with_stdio(0);
  cin >> a >> b >> c >> d;
  int cnt = 0, id;
  tc[1] = 'A', tc[2] = 'B', tc[3] = 'C', tc[4] = 'D';
  n[1] = int((a).size()) - 2, n[2] = int((b).size()) - 2,
  n[3] = int((c).size()) - 2, n[4] = int((d).size()) - 2;
  for (int i = 1; i <= 4; ++i) {
    int x = 0, y = 0;
    for (int j = 1; j <= 4; ++j) {
      if (i == j) continue;
      if (n[i] * 2 <= n[j])
        x++;
      else if (n[i] >= n[j] * 2)
        y++;
    }
    if (x == 3 || y == 3) {
      id = i;
      cnt++;
      if (cnt == 2) {
        cout << "C" << endl;
        return 0;
      }
    }
  }
  if (cnt == 0)
    cout << "C" << endl;
  else
    cout << tc[id] << endl;
  return 0;
}
