#include <bits/stdc++.h>
using namespace std;
const char a[4] = {'A', 'B', 'C', 'D'};
int nho, dem, A[5];
string s;
bool check(int j) {
  bool b = true;
  for (int i = 1; i <= 4; ++i) {
    if (i == j) continue;
    if (A[j] * 2 > A[i]) {
      b = false;
      break;
    }
  }
  if (b) return true;
  b = true;
  for (int i = 1; i <= 4; ++i) {
    if (i == j) continue;
    if (A[j] < A[i] * 2) {
      b = false;
      break;
    }
  }
  return b;
}
int main() {
  if (0) {
    freopen("input.txt", "r", stdin);
  }
  cin >> s;
  A[1] = s.length() - 2;
  cin >> s;
  A[2] = s.length() - 2;
  cin >> s;
  A[3] = s.length() - 2;
  cin >> s;
  A[4] = s.length() - 2;
  for (int i = 1; i <= 4; ++i)
    if (check(i)) dem++, nho = i - 1;
  if (dem == 1) {
    cout << a[nho] << endl;
    return 0;
  } else
    cout << 'C' << endl;
  return 0;
}
