#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c, d;
  cin >> a >> b >> c >> d;
  int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  if ((a.size() - 2) >= (b.size() - 2) * 2 &&
      (a.size() - 2) >= (c.size() - 2) * 2 &&
      (a.size() - 2) >= (d.size() - 2) * 2) {
    c1 = 1;
  } else if ((a.size() - 2) * 2 <= (b.size() - 2) &&
             (a.size() - 2) * 2 <= (c.size() - 2) &&
             (a.size() - 2) * 2 <= (d.size() - 2)) {
    c1 = 1;
  }
  if ((b.size() - 2) >= (a.size() - 2) * 2 &&
      (b.size() - 2) >= (c.size() - 2) * 2 &&
      (b.size() - 2) >= (d.size() - 2) * 2) {
    c2 = 1;
  } else if ((b.size() - 2) * 2 <= (a.size() - 2) &&
             (b.size() - 2) * 2 <= (c.size() - 2) &&
             (b.size() - 2) * 2 <= (d.size() - 2)) {
    c2 = 1;
  }
  if ((c.size() - 2) >= (a.size() - 2) * 2 &&
      (c.size() - 2) >= (b.size() - 2) * 2 &&
      (c.size() - 2) >= (d.size() - 2) * 2) {
    c3 = 1;
  } else if ((c.size() - 2) * 2 <= (a.size() - 2) &&
             (c.size() - 2) * 2 <= (b.size() - 2) &&
             (c.size() - 2) * 2 <= (d.size() - 2)) {
    c3 = 1;
  }
  if ((d.size() - 2) >= (a.size() - 2) * 2 &&
      (d.size() - 2) >= (b.size() - 2) * 2 &&
      (d.size() - 2) >= (c.size() - 2) * 2) {
    c4 = 1;
  } else if ((d.size() - 2) * 2 <= (a.size() - 2) &&
             (d.size() - 2) * 2 <= (b.size() - 2) &&
             (d.size() - 2) * 2 <= (c.size() - 2)) {
    c4 = 1;
  }
  if (c1 + c2 + c3 + c4 > 1 || c1 + c2 + c3 + c4 == 0)
    cout << c[0] << endl;
  else {
    if (c1 == 1)
      cout << a[0] << endl;
    else if (c2 == 1)
      cout << b[0] << endl;
    else if (c3 == 1)
      cout << c[0] << endl;
    else if (c4 == 1)
      cout << d[0] << endl;
  }
  return 0;
}
