#include <bits/stdc++.h>
using namespace std;
int main() {
  string A, B, C, D;
  cin >> A >> B >> C >> D;
  int a = A.size() - 2, b = B.size() - 2, c = C.size() - 2, d = D.size() - 2;
  vector<char> ans;
  if ((a * 2) <= b && (a * 2) <= c && (a * 2) <= d)
    ans.push_back('A');
  else if ((a / 2) >= b && (a / 2) >= c && (a / 2) >= d)
    ans.push_back('A');
  if ((b * 2) <= a && (b * 2) <= c && (b * 2) <= d)
    ans.push_back('B');
  else if ((b / 2) >= a && (b / 2) >= c && (b / 2) >= d)
    ans.push_back('B');
  if ((c * 2) <= b && (c * 2) <= a && (c * 2) <= d)
    ans.push_back('C');
  else if ((c / 2) >= b && (c / 2) >= a && (c / 2) >= d)
    ans.push_back('C');
  if ((d * 2) <= b && (d * 2) <= c && (d * 2) <= a)
    ans.push_back('D');
  else if ((d / 2) >= b && (d / 2) >= c && (d / 2) >= a)
    ans.push_back('D');
  if (ans.size() == 1)
    printf("%c\n", ans[0]);
  else
    puts("C");
  return 0;
}
