#include <bits/stdc++.h>
using namespace std;
void Shivam() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  Shivam();
  map<long long, char> mp;
  string s;
  long long x[4], c1 = 0, c2 = 0;
  long long i;
  cin >> s;
  x[0] = s.size() - 2, mp[x[0]] = 'A';
  cin >> s;
  x[1] = s.size() - 2, mp[x[1]] = 'B';
  cin >> s;
  x[2] = s.size() - 2, mp[x[2]] = 'C';
  cin >> s;
  x[3] = s.size() - 2, mp[x[3]] = 'D';
  sort(x, x + 4);
  for (long long i = 1; i <= 3; i++)
    if (x[0] * 2 <= x[i]) c1++;
  for (long long i = 0; i <= 2; i++)
    if (x[3] >= 2 * x[i]) c2++;
  if (c1 == 3 && c2 != 3)
    cout << mp[x[0]];
  else if (c2 == 3 && c1 != 3)
    cout << mp[x[3]];
  else
    cout << 'C';
  return 0;
}
