#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, len[5];
char ch = '_', st[10005];
int main() {
  for (i = 1; i <= 4; i++) {
    cin >> st;
    len[i] = strlen(st) - 2;
  }
  if (len[1] * 2 <= len[2] && len[1] * 2 <= len[3] && len[1] * 2 <= len[4])
    if (ch == '_')
      ch = 'A';
    else
      ch = '-';
  if (len[1] / 2 >= len[2] && len[1] / 2 >= len[3] && len[1] / 2 >= len[4])
    if (ch == '_')
      ch = 'A';
    else
      ch = '-';
  if (len[2] * 2 <= len[1] && len[2] * 2 <= len[3] && len[2] * 2 <= len[4])
    if (ch == '_')
      ch = 'B';
    else
      ch = '-';
  if (len[2] / 2 >= len[1] && len[2] / 2 >= len[3] && len[2] / 2 >= len[4])
    if (ch == '_')
      ch = 'B';
    else
      ch = '-';
  if (len[3] * 2 <= len[1] && len[3] * 2 <= len[2] && len[3] * 2 <= len[4])
    if (ch == '_')
      ch = 'C';
    else
      ch = '-';
  if (len[3] / 2 >= len[1] && len[3] / 2 >= len[2] && len[3] / 2 >= len[4])
    if (ch == '_')
      ch = 'C';
    else
      ch = '-';
  if (len[4] * 2 <= len[1] && len[4] * 2 <= len[3] && len[4] * 2 <= len[2])
    if (ch == '_')
      ch = 'D';
    else
      ch = '-';
  if (len[4] / 2 >= len[1] && len[4] / 2 >= len[3] && len[4] / 2 >= len[2])
    if (ch == '_')
      ch = 'D';
    else
      ch = '-';
  if (ch == '_' || ch == '-')
    cout << 'C';
  else
    cout << ch;
  return 0;
}
