#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
using ll = int64_t;
using ull = uint64_t;
using ld = long double;
int len[4];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin.exceptions(cin.failbit);
  ;
  for (int i = 0; i < 4; ++i) {
    string s;
    cin >> s;
    len[i] = s.length() - 2;
  }
  int ma = 1, mb = 1;
  int a = min_element(len, len + 4) - len;
  for (int i = 0; i < 4; ++i) {
    if (i == a) continue;
    if (2 * len[a] > len[i]) {
      ma = 0;
      break;
    }
  }
  int b = max_element(len, len + 4) - len;
  for (int i = 0; i < 4; ++i) {
    if (i == b) continue;
    if (len[b] < 2 * len[i]) {
      mb = 0;
      break;
    }
  }
  if (ma && mb) {
    cout << 'C' << endl;
  } else if (ma) {
    cout << char('A' + a) << endl;
  } else if (mb) {
    cout << char('A' + b) << endl;
  } else {
    cout << 'C' << endl;
  }
}
