#include <bits/stdc++.h>
using namespace std;
struct node {
  char a[105];
  int num;
  char flag;
} s[5];
int main() {
  memset(s, 0, sizeof(s));
  for (int i = 1; i <= 4; i++) {
    cin >> s[i].a;
    s[i].num = strlen(s[i].a) - 2;
  }
  s[1].flag = 'A';
  s[2].flag = 'B';
  s[3].flag = 'C';
  s[4].flag = 'D';
  int tmp = 0, f = 0;
  for (int i = 1; i <= 4; i++) {
    int cnts = 0, cntb = 0;
    for (int j = 1; j <= 4; j++) {
      if (s[i].num >= 2 * s[j].num) {
        cntb++;
      }
      if (s[i].num * 2 <= s[j].num) {
        cnts++;
      }
    }
    if (f == 0 && (cnts == 3 || cntb == 3)) {
      f = 1;
      tmp = i;
      continue;
    }
    if (f && (cnts == 3 || cntb == 3)) {
      tmp = 0;
      break;
    }
  }
  if (tmp == 0)
    cout << 'C' << endl;
  else
    cout << s[tmp].flag << endl;
  return 0;
}
