#include <bits/stdc++.h>
using namespace std;
string a, b, c, d;
pair<int, char> arr[10];
bool cek1, cek2;
int main() {
  cin >> a;
  cin >> b;
  cin >> c;
  cin >> d;
  arr[0] = make_pair(a.length() - 2, 'A');
  arr[1] = make_pair(b.length() - 2, 'B');
  arr[2] = make_pair(c.length() - 2, 'C');
  arr[3] = make_pair(d.length() - 2, 'D');
  sort(arr, arr + 4);
  cek1 = cek2 = false;
  if (arr[0].first * 2 <= arr[1].first) cek1 = true;
  if (arr[3].first >= 2 * arr[2].first) cek2 = true;
  if (cek1 && !cek2)
    cout << arr[0].second << endl;
  else if (!cek1 && cek2)
    cout << arr[3].second << endl;
  else
    cout << "C" << endl;
}
