#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int gcd(int a, int b) {
  int r, i;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
struct ax {
  int s;
  char in;
};
bool cmp(struct ax a, struct ax b) { return a.s < b.s; }
int main() {
  char a[10010];
  char b[10010];
  char c[10010];
  char d[10010];
  struct ax aa[5];
  int t, i, j, n, m, k, p;
  cin >> a;
  cin >> b;
  cin >> c;
  cin >> d;
  aa[0].s = strlen(a) - 2;
  aa[1].s = strlen(b) - 2;
  aa[2].s = strlen(c) - 2;
  aa[3].s = strlen(d) - 2;
  aa[0].in = 'A';
  aa[1].in = 'B';
  aa[2].in = 'C';
  aa[3].in = 'D';
  sort(aa, aa + 4, cmp);
  if (2 * aa[0].s <= aa[1].s && aa[3].s >= 2 * aa[2].s) {
    cout << "C\n";
  } else if (2 * aa[0].s <= aa[1].s) {
    cout << aa[0].in << "\n";
  } else if (aa[3].s >= 2 * aa[2].s) {
    cout << aa[3].in << "\n";
  } else {
    cout << "C\n";
  }
  return 0;
}
