#include <bits/stdc++.h>
using namespace std;
int len(string s) {
  int orig = s.size();
  orig -= 2;
  return orig;
}
int main() {
  string choices[4];
  for (int c = 0; c < 4; c++) {
    cin >> choices[c];
  }
  int smallcount = 0;
  char smallmeow;
  int bigcount = 0;
  char bigmeow;
  for (int i = 0; i < 4; ++i) {
    bool good = true;
    for (int k = 0; k < 4; ++k) {
      if (i == k) {
        continue;
      }
      if (len(choices[i]) * 2 > len(choices[k])) {
        good = false;
      }
    }
    if (good) {
      ++smallcount;
      smallmeow = choices[i][0];
    }
  }
  for (int i = 0; i < 4; ++i) {
    bool good = true;
    for (int c = 0; c < 4; c++) {
      if (i == c) {
        continue;
      }
      if (len(choices[i]) < len(choices[c]) * 2) {
        good = false;
      }
    }
    if (good) {
      bigcount++;
      bigmeow = choices[i][0];
    }
  }
  if (smallcount + bigcount > 1 || smallcount + bigcount == 0) {
    cout << "C" << endl;
  } else if (bigcount == 1) {
    cout << bigmeow << endl;
  } else if (smallcount == 1) {
    cout << smallmeow << endl;
  }
}
