#include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 1;
const int MOD = int(1e9) + 7;
const double EPS = 1e-6;
char s[4][120];
int i, j, ans = -1;
int main() {
  int a[4], cnt = 0;
  char b[4] = {'A', 'B', 'C', 'D'};
  for (i = (0); i <= (3); i++) {
    scanf("%s", s[i]);
    a[i] = strlen(s[i]) - 2;
  }
  for (i = (0); i <= (3); i++) {
    int f1, f2;
    f1 = f2 = 1;
    for (j = (0); j <= (3); j++) {
      if (j == i) continue;
      if (2 * a[i] > a[j]) f1 = 0;
      if (a[i] < 2 * a[j]) f2 = 0;
    }
    if (f1 || f2) cnt++, ans = i;
  }
  if (ans != -1 && cnt == 1)
    cout << b[ans] << endl;
  else
    cout << 'C' << endl;
  return 0;
}
