#include <bits/stdc++.h>
using namespace std;
char question[4][100];
int len[4];
int main() {
  for (int i = 0; i < 4; i++) {
    cin >> question[i];
    string s = question[i];
    len[i] = s.size() - 2;
  }
  int count_ = 0;
  int index = -1;
  for (int i = 0; i < 4; i++) {
    int n;
    n = len[0];
    len[0] = len[i];
    len[i] = n;
    if (((len[0] <= (len[1] / 2)) && (len[0] <= (len[2] / 2)) &&
         (len[0] <= (len[3] / 2))) ||
        ((len[0] >= (2 * len[1])) && (len[0] >= (2 * len[2])) &&
         (len[0] >= (2 * len[3])))) {
      index = i;
      count_++;
    }
  }
  if (count_ == 1) {
    cout << (char)(index + 65);
  } else {
    cout << 'C';
  }
  return 0;
}
