#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[5][110];
  int len[5], mark, i, j, num, temp, k;
  int c[5] = {0};
  for (i = 1; i <= 4; i++) gets(s[i]);
  for (i = 1; i <= 4; i++) len[i] = strlen(s[i]) - 2;
  num = 0;
  for (i = 1; i <= 4; i++) {
    temp = 0;
    for (j = 1; j <= 4; j++)
      if (j != i && len[i] * 2 <= len[j]) temp++;
    if (temp < 3) {
      temp = 0;
      for (j = 1; j <= 4; j++)
        if (j != i && len[i] >= len[j] * 2) temp++;
      if (temp >= 3) num++, c[i] = 1;
    } else
      num++, c[i] = 1;
  }
  if (num == 1) {
    for (i = 1; i <= 4; i++)
      if (c[i] != 0) {
        printf("%c\n", i + 'A' - 1);
        break;
      }
  } else
    cout << "C" << endl;
  return 0;
}
