#include <bits/stdc++.h>
using namespace std;
struct AA {
  int a, i;
};
int cmp(AA b, AA c) { return b.a < c.a; }
int main() {
  char a[120], b[120], c[120], d[120];
  scanf("%s%s%s%s", a, b, c, d);
  AA aa[4];
  aa[0].a = strlen(a) - 2;
  aa[0].i = 0;
  aa[1].a = strlen(b) - 2;
  aa[1].i = 1;
  aa[2].a = strlen(c) - 2;
  aa[2].i = 2;
  aa[3].a = strlen(d) - 2;
  aa[3].i = 3;
  sort(aa, aa + 4, cmp);
  int vis = 0;
  int k;
  if (aa[0].a * 2 <= aa[3].a && aa[0].a * 2 <= aa[2].a &&
      aa[0].a * 2 <= aa[1].a) {
    vis++;
    k = aa[0].i;
  }
  if (aa[3].a >= aa[0].a * 2 && aa[3].a >= aa[1].a * 2 &&
      aa[3].a >= aa[2].a * 2) {
    vis++;
    k = aa[3].i;
  }
  if (vis == 1)
    cout << (char)(k + 'A') << endl;
  else
    cout << "C" << endl;
  return 0;
}
