#include <bits/stdc++.h>
using namespace std;
int main() {
  int k = 0, j = 0, l = 0, m = 0;
  int z = 0, x = 0, p = 0, v = 0;
  string a, b, c, d;
  cin >> a >> b >> c >> d;
  if ((b.size() - 2 >= 2 * (a.size() - 2)) &&
      (b.size() - 2 >= 2 * (c.size() - 2)) &&
      (b.size() - 2 >= 2 * (d.size() - 2)))
    k++;
  if ((a.size() - 2 >= 2 * (b.size() - 2)) &&
      (a.size() - 2 >= 2 * (c.size() - 2)) &&
      (a.size() - 2 >= 2 * (d.size() - 2)))
    j++;
  if ((c.size() - 2 >= 2 * (a.size() - 2)) &&
      (c.size() - 2 >= 2 * (b.size() - 2)) &&
      (c.size() - 2 >= 2 * (d.size() - 2)))
    l++;
  if ((d.size() - 2 >= 2 * (a.size() - 2)) &&
      (d.size() - 2 >= 2 * (c.size() - 2)) &&
      (d.size() - 2 >= 2 * (b.size() - 2)))
    m++;
  if ((2 * (b.size() - 2) <= (a.size() - 2)) &&
      (2 * (b.size() - 2) <= (c.size() - 2)) &&
      (2 * (b.size() - 2) <= (d.size() - 2)))
    z++;
  if ((2 * (a.size() - 2) <= (b.size() - 2)) &&
      (2 * (a.size() - 2) <= (c.size() - 2)) &&
      (2 * (a.size() - 2) <= (d.size() - 2)))
    x++;
  if ((2 * (c.size() - 2) <= (a.size() - 2)) &&
      (2 * (c.size() - 2) <= (b.size() - 2)) &&
      (2 * (c.size() - 2) <= (d.size() - 2)))
    p++;
  if ((2 * (d.size() - 2) <= (a.size() - 2)) &&
      (2 * (d.size() - 2) <= (c.size() - 2)) &&
      (2 * (d.size() - 2) <= (b.size() - 2)))
    v++;
  if (k == 1 && j != 1 && l != 1 && m != 1 && x != 1 && p != 1 && v != 1 &&
      z != 1)
    printf("B");
  else if (j == 1 && l != 1 && m != 1 && k != 1 && x != 1 && p != 1 && v != 1 &&
           z != 1)
    printf("A");
  else if (l == 1 && m != 1 && j != 1 && k != 1 && x != 1 && p != 1 && v != 1 &&
           z != 1)
    printf("C");
  else if (m == 1 && k != 1 && j != 1 && l != 1 && x != 1 && p != 1 && v != 1 &&
           z != 1)
    printf("D");
  else if (z == 1 && x != 1 && p != 1 && v != 1 && j != 1 && l != 1 && m != 1 &&
           k != 1)
    printf("B");
  else if (x == 1 && p != 1 && v != 1 && z != 1 && j != 1 && l != 1 && m != 1 &&
           k != 1)
    printf("A");
  else if (p == 1 && v != 1 && x != 1 && z != 1 && j != 1 && l != 1 && m != 1 &&
           k != 1)
    printf("C");
  else if (v == 1 && p != 1 && x != 1 && z != 1 && j != 1 && l != 1 && m != 1 &&
           k != 1)
    printf("D");
  else
    printf("C");
  return 0;
}
