Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.Fortunately the child knows how to solve such complicated test. The child will follow the algorithm:  If there is some choice whose description at least twice shorter than all other descriptions, or at least twice longer than all other descriptions, then the child thinks the choice is great.  If there is exactly one great choice then the child chooses it. Otherwise the child chooses C (the child think it is the luckiest choice). You are given a multiple-choice questions, can you predict child's choose?

The first line starts with "A." (without quotes), then followed the description of choice A. The next three lines contains the descriptions of the other choices in the same format. They are given in order: B, C, D. Please note, that the description goes after prefix "X.", so the prefix mustn't be counted in description's length. Each description is non-empty and consists of at most 100 characters. Each character can be either uppercase English letter or lowercase English letter, or "_".

Print a single line with the child's choice: "A", "B", "C" or "D" (without quotes).

NoteIn the first sample, the first choice has length 39, the second one has length 35, the third one has length 37, and the last one has length 15. The choice D (length 15) is twice shorter than all other choices', so it is great choice. There is no other great choices so the child will choose D.In the second sample, no choice is great, so the child will choose the luckiest choice C.In the third sample, the choice B (length 2) is twice longer than all other choices', so it is great choice. There is no other great choices so the child will choose B.

#include <iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;

int main()
{
   string a,b,c,d;
   cin>>a>>b>>c>>d;
   unsigned int lAs,lAl,lBs,lBl,lCs,lCl,lDs,lDl;
   lAs=a.size()-2;
   lBs=b.size()-2;
   lCs=c.size()-2;
   lDs=d.size()-2;
   lAl=(a.size()-2)*2;
   lBl=(b.size()-2)*2;
   lCl=(c.size()-2)*2;
   lDl=(d.size()-2)*2;
   //cout<<lAs<<" "<<lBs<<" "<<lCs<<" "<<lDs<<" "<<lAl<<" "<<lBl<<" "<<lCl<<" "<<lDl<<endl;
   int m=0;
   if     ( (lAl<=lBs && lAl<=lCs && lAl<=lDs) || (lAs>=lBl && lAs>=lCl && lAs>=lDl) ){
    //cout<<'A';
    m++;
   }
   if( (lBl<=lAs && lBl<=lCs && lBl<=lDs) || (lBs>=lAl && lBs>=lCl && lBs>=lDl) ){
    //cout<<'B';
    m++;
   }
   if( (lCl<=lBs && lCl<=lAs && lCl<=lDs) || (lCs>=lBl && lCs>=lAl && lCs>=lDl) ){
    //cout<<'C';
    m++;
   }
   if( (lDl<=lBs && lDl<=lCs && lDl<=lAs) || (lDs>=lBl && lDs>=lCl && lDs>=lAl) ){
    //cout<<'D';
    m++;
   }

   if(m==1){
        if     ( (lAl<=lBs && lAl<=lCs && lAl<=lDs) || (lAs>=lBl && lAs>=lCl && lAs>=lDl) ){
        cout<<'A';
        }
        else if( (lBl<=lAs && lBl<=lCs && lBl<=lDs) || (lBs>=lAl && lBs>=lCl && lBs>=lDl) ){
        cout<<'B';
        }
        else if( (lCl<=lBs && lCl<=lAs && lCl<=lDs) || (lCs>=lBl && lCs>=lAl && lCs>=lDl) ){
        cout<<'C';
        }
        else if( (lDl<=lBs && lDl<=lCs && lDl<=lAs) || (lDs>=lBl && lDs>=lCl && lDs>=lAl) ){
        cout<<'D';
        }
   }
   else{
    cout<<'C';
   }
   return 0;
}

#include <bits/stdc++.h>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
  int i, a[4],x,y,j,k=0;
  string s;int ans[4];

  for(i=0;i<4;i++)
  {
      getline(cin,s);
      a[i]=s.length() -2;
      //cout<<a[i]<<" ";
  }
  for(i=0;i<4;i++)
  {
      x=0;y=0;
    for(j=0;j<4;j++)
    {
        if(2*a[i]<=a[j])
        {
            x++;
        }
        if(a[i]>=2*a[j])
        y++;
    }
    if(x==3||y==3)
    {
    ans[k++]=i;
    }

}
if(k==1)
cout<<(char)(ans[0]+65);
else
cout<<(char)(2+65);
return 0;}

#include<iostream>
#include<string>
using namespace std;
int main()
{
	string str[4];
	int arr[4];
	for (int i = 0; i < 4; i++)
	{
		cin >> str[i];
		arr[i] = str[i].length() - 2;
	}
	int min = arr[0];
	int minindex = 0;
	int max = arr[0];
	int maxindex = 0;
	for (int i = 0; i < 4; i++)
	{
		if (arr[i] > max)
		{
			max = arr[i];
			maxindex = i;
		}
		if (arr[i] < min)
		{
			min = arr[i];
			minindex = i;
		}
	}
	for (int i = 0; i < 3; i++)
	{

		for (int index = 0; index < 3; index++)
		{
			if (arr[index] > arr[index + 1])
				std::swap(arr[index], arr[index + 1]);
		}
	}
	if (arr[0] <= arr[1] / 2 && arr[3] >= arr[2] * 2)
	{
		cout << "C";
		return 0;
	}
	else if (arr[0] <= arr[1] / 2 && arr[3] < arr[2] * 2)
	{
		cout << (char)(65 + minindex);

		return 0;
	}
	else if (arr[0] > arr[1] / 2 && arr[3] >= arr[2] * 2)
	{
		cout << (char)(65 + maxindex);

		return 0;
	}
	else
		cout << "C";
	return 0;

}

#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <tuple>
#include <limits>

using namespace std;
typedef tuple<int,string> T;

int main(){
    string A,B,C,D;
    cin >> A >> B >> C >> D;
    vector<T> v = {T(A.size()-2,"A"),T(B.size()-2,"B"),
                T(C.size()-2,"C"),T(D.size()-2,"D")};
    sort(v.begin(),v.end(),[](T a, T b){return a < b;});
    bool first = false; bool last = false;
    if (get<0>(v[0])*2 <= get<0>(v[1])) first = true;
    if (get<0>(v[3]) >= get<0>(v[2])*2) last = true;
    if((first && last) || (!first & !last)) cout << "C" << endl;
    else{
        if(first) cout << get<1>(v[0]) << endl;
        if(last) cout << get<1>(v[3]) << endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define word second.first
#define l first
#define ans second.second

int main() {
    vector<pair<int, pair<string, char> > > V(4);
    char a , b;
    cin >> a >> b >> V[0].word;
    V[0].l = V[0].word.size();
    V[0].ans = 'A';

    cin >> a >> b >> V[1].word;
    V[1].l = V[1].word.size();
    V[1].ans = 'B';

    cin >> a >> b >> V[2].word;
    V[2].l = V[2].word.size();
    V[2].ans = 'C';

    cin >>  a >> b >> V[3].word;
    V[3].l = V[3].word.size();
    V[3].ans = 'D';

    sort(V.begin() , V.end());
    bool A = V[0].l <= V[1].l / 2 , B = V[3].l >= V[2].l * 2;
    if(A && B) {
        cout << 'C' << endl;
    }
    else if(A) {
        cout << V[0].ans << endl;
    }
    else if(B) {
        cout << V[3].ans << endl;
    }
    else {
        cout << 'C' << endl;
    }
    return 0;
}

#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cassert>

using namespace std;
#define max(A,B) (A)>(B)?(A):(B)
#define min(A,B) (A)<(B)?(A):(B)
#define fori(i,n) for(i=0;i<n;i++)
#define ford(i,n) for(i=n-1;i>=0;i--)
#define wh(t) while(t--)
#define sc(a) scanf("%d",&a)
#define pr(a) printf("%d\n",a)
#define sc64(a) scanf("%I64d",&a)
#define pr64(a) printf("%I64d\n",a)
#define scs(a) scanf("%s",a)
#define prs(a) printf("%s\n",a)
#define ll long long int
#define MOD 1000000007
#define pb push_back
int main()
{
string s1,s2,s3,s4,ans;
int l[4];
cin>>s1;
cin>>s2;
cin>>s3;
cin>>s4;
l[0]=s1.length()-2;
l[1]=s2.length()-2;
l[2]=s3.length()-2;
l[3]=s4.length()-2;
 int max=0;
 int min=110;
 int temp1,temp2;
 for(int i=0;i<4;i++)
 {
 if(l[i]>max)
 {
 max=l[i];
 temp1=i;
 }
 if(l[i]<min)
 {
 min=l[i];
 temp2=i;
 }
 }
 int count1=0,count2=0;
 //cout<<max<<" "<<temp1<<endl;
// cout<<min<<" "<<temp2<<endl;
 for(int i=0;i<4;i++)
 {
 if(i!=temp1)
 {
 if(max>=2*l[i])
 count1++;
 }
 }
//cout<<count1<<endl;
 for(int i=0;i<4;i++)
 {
 if(i!=temp2)
 {
 if(min<=l[i]/2)
 count2++;
 }
 }
 if(count1==3)
 {

 if(temp1==0)
 ans="A";
 else if(temp1==1)
 ans="B";
 else if(temp1==2)
 ans="C";
 else
 ans="D";
 }
if(count2==3)
 {
if(temp2==0)
 ans="A";
 else if(temp2==1)
 ans="B";
 else if(temp2==2)
 ans="C";
 else
 ans="D";
 }
 if(count1<3 && count2<3)
 ans="C";
 if(count1==3 && count2==3)
    ans="C";
 cout<<ans<<endl;
return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define EPS 1e-9
#define INF 1e9+10
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi acos(-1)
#define sf scanf
#define pf printf
#define Equal(a, b) (abs(a-b) < EPS)
#define Greater(a, b) (a >= (b+EPS))
#define GreaterEqual(a, b) (a > (b-EPS))
#define All(x) x.begin(), x.end()
#define fr(i, a, b) for(register int i = (a); i < (int)(b); i++)
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define dbg(vari) cerr << #vari << " = " << (vari) <<endl
#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)
typedef unsigned long long ull;
typedef long long ll;
typedef map<int, int> mii;
typedef map<string, int> msi;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pair<int, int> > vii;

int main() {
	string a;
	char ans[] = {'A', 'B', 'C', 'D'};
	vi v;
	fr(i, 0, 4) {
		cin >> a;
		v.pb((int)a.size()-2);
	}

	auto mn = min_element(All(v));
	int ps = mn - v.begin();
	int cnt = count(All(v), *mn);
	bool ok = 0;
	int found = -1;
	if(cnt == 1) {
		ok = 1;
		fr(i, 0, 4) {
			if(ps == i)
				continue;
			if((*mn)*2 > v[i])
				ok = 0;
		}
	}

	if(ok) found = ps;

	auto mx = max_element(All(v));
	ps = mx - v.begin();
	cnt = count(All(v), *mx);
	//dbg(cnt);
	ok = 0;
	if(cnt == 1) {
		ok = 1;
		fr(i, 0, 4) {
			if(i == ps)
				continue;
			if(v[i]*2 > *mx)
				ok = 0;
		}
	}

	if(ok == 1 && found == -1)
		cout << ans[ps] << endl;
	else if(!ok && found != -1)
		cout << ans[found] << endl;
	else
		cout << "C" <<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	string s[4];
	for(int i=0;i<4;i++)
		cin>>s[i];
	int c[4],flag,length[4],d[4];
	for(int i=0;i<4;i++){
		length[i]=s[i].size()-2;
		c[i]=0;
		d[i]=0;
	}
	for(int i=0;i<4;i++){
		for(int j=0;j<4;j++){
			if((2*length[i])<=length[j])
				c[i]++;
			if(length[i]>=(2*length[j]))
				d[i]++;
		}
	}
	char x;
	for(int i=0;i<4;i++){
		if(c[i]==3||d[i]==3){
			x=s[i].at(0);
			flag++;
		}
	}
	if(flag==1)
		cout<<x<<"\n";
	else
		cout<<"C\n";
	return 0;
}

// Thank you, vjudge4, for http://codeforces.com/contest/437/submission/25819283
#include <iostream>
#include<stdlib.h>
#include<stdio.h>
#include<string>
#include<string.h>
using namespace std;

char ch[4][105];
int l[4];
int l2[4];
int main()
{

	cin>>ch[0];
	l[0] = strlen(ch[0])-2;
	cin>>ch[1];
	l[1]  = strlen(ch[1])-2;
	cin>>ch[2];
	l[2] = strlen(ch[2])-2;
	cin>>ch[3];
	l[3]  = strlen(ch[3])-2;
	for(int i=0;i<4;i++)
	{
		l2[i]=l[i];
	}

	for(int i=0;i<4;i++)
	{
		for(int j=1;j<4;j++)
		{
			if(l[j]>l[j-1])
			{
				int tmp=l[j];
				l[j]=l[j-1];
				l[j-1]=tmp;

			}

		}
	}

	int flag =0;
	int tmp=0;
	if(l[0]>=l[1]*2&&l[2]>=l[3]*2)
	{
		printf("C");
	}
	else	if(l[0]>=l[1]*2)
	{
		for(int i=3;i>=0;i--)
		{
			if(l2[i]==l[0])
			{
				printf("%c",i+65);
			}
		}
	}
	else if(l[2]>=l[3]*2)
	{
		for(int i=3;i>=0;i--)
		{
			if(l2[i]==l[3])
			{
				printf("%c",i+65);
			}
		}
	}
	else
	{
		printf("C");
	}

}

#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
int ans[4];
int main(){
    for(int i = 0 ; i < 4 ; i ++){
        string s;
        getline(cin,s);
        ans[i] = s.size() - 2;
    }
    int res = 'C';
    int c = 0;
    for(int i = 0 ; i < 4 ; i ++){
        int up = 0, low = 0;
    for(int j = 0 ; j < 4 ; j ++){
        if(i != j){
            if(ans[i] >= ans[j] * 2) up ++;
            if(ans[i] * 2 <= ans[j]) low ++;
        }
    }
        if(up == 3 || low == 3){
            res = 'A' + i;
            c ++;
        }
    }
    if(c == 1)
    printf("%c",res);
    else puts("C");

}

#include <stdio.h>
#include <string.h>
template <typename T>T min(T x,T y){return x<y?x:y;}
template <typename T>T max(T x,T y){return x>y?x:y;}
template <typename T>T abs(T x){return x>0?x:-x;}
template <typename T>T gcd(T x,T y){return x?gcd(y%x,x):y;}
typedef long long ll;
char a[4][150];
int l[4];
int main()
{
	while(~scanf("%s",a[0]))
	{
		l[0]=strlen(a[0])-2;
		for(int i=1;i<4;i++)
		{
			scanf("%s",a[i]);
			l[i]=strlen(a[i])-2;
		}
		char c=2;
		bool f=false;
		for(int i=0;i<4;i++)
		{
			//printf("%d\n",l[i]);
			bool shroter=true,longer=true;
			for(int j=0;j<4;j++)
			{
				if(j==i)continue;
				if(l[j]>l[i]/2)shroter=false;
				if(l[j]<2*l[i])longer=false;
			}
			if(shroter||longer)
			{
				if(!f){c=i;f=true;}
				else c=2;
			}

		}
		printf("%c\n",c+'A');
	}
}

#include<bits/stdc++.h>
using namespace std;
const int MAX_N = 2e5+9;
char vec[5][MAX_N];
typedef pair<int ,int> P;
P len[5];
bool cmp(const P a,const P b)
{
    return a.first<b.first;
}
int main()
{
    int N,M,T;
    for(int i=0;i<4;i++)
    {
        scanf("%s",vec[i]);
        len[i].first = strlen(vec[i]) - 2;
        len[i].second = i;
    }
    sort(len,len+4,cmp);
    int flag = 0;
    int ans = -1;
    //for(int i=0;i<4;i++) cout<<"...."<<len[i].first<<endl;
    if(len[0].first*2 <= len[1].first && len[1].first!= 0)
    {

        ans = len[0].second;
        flag ++;
    }
    if(len[3].first >= 2*len[2].first && len[3].first!=0)
    {
        ans = len[3].second;
        flag ++;
    }
    //cout<<flag<<endl;
    if(flag==0 || flag == 2)
    {
        printf("C\n");
    }
    else printf("%c\n",ans+'A');
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
struct my
{
    string s;
    int l;
};

int main()
{
    string s5,s1,s2,s3,s4;
    my ara[6];
    int i,temp;
    while(cin>>s1>>s2>>s3>>s4)
    {
        i=0;
        ara[i].l=s1.length()-2;ara[i].s=s1[0];i++;
        ara[i].l=s2.length()-2;ara[i].s=s2[0];i++;
        ara[i].l=s3.length()-2;ara[i].s=s3[0];i++;
        ara[i].l=s4.length()-2;ara[i].s=s4[0];i++;
        //sort(ara+1,ara+i);
        for(int k=0;k<4;k++){
            for(int m=k+1;m<4;m++){
                if(ara[k].l>ara[m].l){
                        temp=ara[k].l;
                        ara[k].l=ara[m].l;
                        ara[m].l=temp;
                        s5=ara[k].s;
                        ara[k].s=ara[m].s;
                        ara[m].s=s5;
                }
            }
        }
       // for(int j=0;j<4;j++)
         //   cout<<ara[j].l<<' '<<ara[j].s<<endl;

        if((2*ara[0].l<=ara[1].l)&&(2*ara[2].l>ara[3].l))
            cout<<ara[0].s<<endl;
        else if((2*ara[0].l>ara[1].l)&&(2*ara[2].l<=ara[3].l))
            cout<<ara[3].s<<endl;
        else
            cout<<"C"<<endl;
    }
}

#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;

int main() {
    int b[5], l[5], length=2;
    char tmp[200];
    for(int i=0; i<4; i++) {
        cin>>tmp;
        b[i] = l[i] = strlen(tmp) - 2;
    }

    sort(l, l+4);
    if((l[3]>=2*l[2])^(2*l[0]<=l[1])) {
        length=(2*l[0]<=l[1])?l[0]:l[3];
        for(int i=0; i<4; i++)
            if(b[i] == length) cout<<(char)('A'+i)<<endl;
    } else {
        cout<<"C"<<endl;
    }
}

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

bool func(string a, string b) {
    return (a.size() < b.size());
}

int main() {
    bool pass1 = true, pass2 = true;
    string str[4];
    for (int i = 0; i < 4; ++i) {
        getline(cin, str[i]);
    }
    sort(str, str + 4, func);
    int Min = str[0].size() - 2;
    pass1 = true;
    for (int i = 1; i < 4; ++i) {
        if (2 * Min > (str[i].size() - 2)) {
            pass1 = false;
            break;
        }
    }
    int Max = str[3].size() - 2;
    pass2 = true;
    for (int i = 2; i >= 0; --i) {
        if (Max < 2 * (str[i].size() - 2)) {
            pass2 = false;
            break;
        }
    }
    if (!(pass2 ^ pass1)) {
        cout << "C" << endl;
    }
    else if (pass1) {
        cout << str[0][0] << endl;
    }
    else cout << str[3][0] << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;*/
int dx[]={0,0,1,-1,-1,-1,1,1};
int dy[]={1,-1,0,0,-1,1,-1,1};
int freq[10000];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    pair<int,int>p[4];
    string s,ans="ABCD";
    bool a=0,b=0;
    for(int i=0;i<4;++i)
    {
        cin>>s;
        p[i]=make_pair(s.size()-2,i);
    }
    sort(p,p+4);
    int x=p[0].first*2,y=p[3].first;
    if(x<=p[1].first&&x<=p[2].first&&x<=p[3].first)
        a=1;
    if(y>=p[0].first*2&&y>=p[1].first*2&&y>=p[2].first*2)
        b=1;
    if(a+b!=1)
        cout<<"C";
    else
        cout<<(a?ans[p[0].second]:ans[p[3].second]);
    return 0;
}

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>

using namespace std;

#define ll long long
#define ull unsigned long long
#define mp make_pair
#define pb push_back
#define maxn 300005

int main(){

    string s;
    int len[5];

   for (int i = 1; i <= 4; i++) {
        cin >> s;
        len[i] = s.length() - 2;
    }
    int flag = 0;
    int out = -1;
    for (int i = 1; i <= 4; i++) {
        int cou1 = 0, cou2 = 0;
        for (int j = 1; j <= 4; j++) {
            if (i == j) continue;
            if (len[i] >= 2 * len[j]) cou1++;
            if (len[i] * 2 <= len[j]) cou2++;
        }
        if (cou1 >= 3 || cou2 >= 3) {
            flag++; out = i;
        }
    }
    if (flag == 1)  cout<<(char)(out - 1 + 'A')<<endl;
    else cout << 'C' << endl;

    //system("pause");
    return 0;
}

#include<bits/stdc++.h>
//#include <iomanip>
#define hell                         1000000007
#define M                            1000000007
#define Maxi                      10000000000000000
#define lcm(a,b)                     (a*b)/__gcd(a,b)
#define ll                           long long

#define vll                          vector<ll>
#define vi                           vector<long long>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
//#define mp                           make_pair
#define all(v)                       v.begin(),v.end()
#define lbnd                         lower_bound
#define ubnd                         upper_bound
#define bs                           binary_search
#define F                            first
#define S                            second
#define rep(i,a,b)                   for(i=a;i<b;i++)
#define parr(a,n)                    for(i=0;i<n;i++) cout<<a[i]<<" ";cout<<endl;
#define pcont(a)                     for(auto i:a) cout<<i<<" ";cout<<endl;
#define ret(x)                       return cout<<x,0;
#define dbg(x)                       cout << #x << " is " << x << endl;
#define endl                           '\n'
 //const ll infl=0x3f3f3f3f3f3f3f3fLL;

 #define pi                           3.141592653589793238
// Debug //

#define trace(x)                 cerr << #x << ": " << x << endl;
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
using namespace std;

/*ll prime[1000006];
void fun()
{
  for(ll i=2;i<=1000000;i++)
  {
    if(prime[i]==0)
    {
      for(ll j=i;j<=1000000;j+=i)
      {
        if(prime[j]==0)
        prime[j]=i;
      }
    }
  }
}*/
/*const int MAXR = 1000005;

ll cubic_root(ll x)
{
    ll l = 0, r = MAXR;
    while (l != r) {
        ll m = (l + r + 1) / 2;
        if (m * m * m > x)
            r = m - 1;
        else
            l = m;
    }
    return l;
}*/

/*ll power(ll x,ll y,ll m)
{
    if (y == 0)
        return 1;
    ll p = power(x, y/2, m) % m;
    p = (p * p) % m;

    return (y%2 == 0)? p : (x * p) % m;
}*/
/*bool checkprime(ll n)
{
  ll i;
  if(n<=3)
    return true;

  if(n%2==0 || n%3==0)
    return false;

  for(i=5;i*i<=n;i+=6)
  {
    if(n%i==0 || n%(i+2)==0)
      return false;
  }

  return true;

}

 ll check(ll n,ll b)
{
  ll i,p=1,P=1,ans=1;
  if(n<3)
    return 0;
  for(i=1;i<=b;i++)
  {
    ans=ans*(n-i+1/i)%hell;
  }

  return ans;
}*/

/*const int N = 1e6+1;

ll prime[N];
//ll n;
vector<ll>p;
vector<int>ans;

void sv()
{
  for(int i=1;i<N;i++)
    prime[i]=1;

  for(int i=2;i*i<=N;i++)
  {
    if(prime[i])
    {
      for(int j=i*i;j<N;j+=i)
      {
        prime[j]=0;
      }
    }
  }

  for(int i=2;i<N;i++)
  {
    if(prime[i])
      p.pb(i);
  }
  return ;
}
*/
/*void solve()
{
  int n;
  cin>>n;
  sv();
  for(auto i:p)
  {
    if(i>n)
      break;

    for(int j=1;pow(i,j)<=n;j++)
      ans.pb(pow(i,j));
  }

  cout<<ans.size()<<endl;
  for(auto i:ans)
    cout<<i<<" ";
  cout<<endl;
  //cout<<"ef"<<endl;
return ;
}*/
/*ll m;
long long fast_power(long long base, long long power) {
    long long result = 1;
    while(power > 0) {

        if(power % 2 == 1) { // Can also use (power & 1) to make code even faster
            result = (result*base) % m;
        }
        base = (base * base) % m;
        power = power / 2; // Can also use power >>= 1; to make code even faster
    }
    return result;
}*/

int main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);cout.tie(NULL);
      string a,b,c,d;
      ll i,j;
      cin>>a>>b>>c>>d;
      ll l[4];
      l[0]=a.size()-2;
      l[1]=b.size()-2;
      l[2]=c.size()-2;
      l[3]=d.size()-2;
      ll cnt=0;
      ll ans=0;
      for(i=0;i<4;i++)
      {
        ll s1=0,s2=0;
        for(j=0;j<4;j++)
        {
            if(i!=j)
            {
                if(2*l[i]<=l[j])s1++;
                if(l[i]>=2*l[j])s2++;
            }
        }
        if(s1==3 || s2==3)
            {
                cnt++;
                ans=i;
            }
      }
      //cout<<ans<<endl;
      if(cnt==1)
      {
        cout<<(char)(65+ans)<<endl;
      }
      else
        cout<<"C"<<endl;
}

#include<bits/stdc++.h>
#include<string.h>
#define int long long
using namespace std;
signed main()
{
    char a[4][103],m1,m2,m=0,n=0,b,c,d=0,e=0;
    for(int i=0;i<4;i++)
        cin>>a[i];
    m1=strlen(a[0]);
    m2=strlen(a[0]);
    for(int i=0;i<4;i++)
    {
        if(strlen(a[i])>=m1)
        {
            m1=strlen(a[i]);
            b=i;
        }
        if(strlen(a[i])<=m2)
        {
            m2=strlen(a[i]);
            c=i;
        }
    }
    for(int i=0;i<4;i++)
    {
        if(m1-2<2*(strlen(a[i])-2)&&strlen(a[i])!=m1)
            m++;
        if(2*(m2-2)>strlen(a[i])-2&&strlen(a[i])!=m2)
            n++;
    }
    if(m==0||n==0)
    {
        for(int i=0;i<4;i++)
        {
            if(m==0&&strlen(a[i])==m1)
                d++;
            if(n==0&&strlen(a[i])==m2)
                e++;
        }
        if(d==1&&e!=1) cout<<a[b][0];
        else if(e==1&&d!=1) cout<<a[c][0];
        else cout<<"C";
    }
    else
        cout<<"C";
}

#include<bits/stdc++.h>
using namespace std;
#define INF (1<<30)

int main()
{
    vector<string>v;
    string s;

   int i,b;
   for(int i=0;i<4;i++)
   {
       cin>>s;
     v.push_back(s);
   }
   int ct=0,num;
   for(int i=0;i<4;i++)
   {
      int mx=-INF,mn=INF;
      for(int j=0;j<4;j++)
      {
          if(i==j) continue;
          mx=max(mx,(int)(v[j].size())-2);
          mn=min(mn,int(v[j].size())-2);
      }
      if(2*(v[i].size()-2)<=mn || v[i].size()-2>=2*mx)ct++,num=i;
   }
   if(ct==1) cout<<char('A'+num)<<endl;
   else puts("C");
}

//In the name of God
//-----gmmj

#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>

#define Rep(I,N) for(int I=0;I<N;++I)
#define For(J,R,K) for(int J=R;J<K;++J)
#define DRI(X) int x;scanf("%d",&X);
#define DRII(X1,Y1) int X1,Y1;scanf("%d%d",&X1,&Y1);
#define RI(X2) scanf("%d",&X2);
#define WI(X4) printf("%d",X4);
#define WII(X5,X6) printf("%d %d",X5,X6);
#define SF scanf
#define PF printf
#define pii pair<int,int>
#define Ff first
#define Ss second
#define Sorts(a,n) Rep(i,n)Rep(j,n-1)if(a[j]>a[j+1])swap(a[j],a[j+1]);
#define Sortn(a,n) Rep(i,n)Rep(j,n-1)if(a[j]<a[j+1])swap(a[j],a[j+1]);
#define Test freopen("a.in","r",stdin);

typedef long long ll;

using namespace std;
pair<int,int> a[5];
int main(){
	string st[5];
 	//Test
	Rep(i,4){
		cin>>st[i];
		a[i].Ff=st[i].size()-2;
		a[i].Ss=i;
	}
	Rep(i,4)
		Rep(j,3)
			if(a[j].Ff<a[j+1].Ff)
					swap(a[j],a[j+1]);
	int l;
	if(a[0].Ff>=2*a[1].Ff && a[3].Ff*2<=a[2].Ff)
		cout<<"C";
	else if(a[0].Ff>=2*a[1].Ff)
		cout<<st[a[0].Ss][0];
	else if(a[3].Ff*2<=a[2].Ff)
		cout<<st[a[3].Ss][0];
	else
		cout<<"C";

	return 0;
}

#include<cstdio>
#include<cstring>
char s[5][200],ans;
int l[5],a[5],b[5],anss;
int main()
{
	for(int i=1;i<=4;i++)
		scanf("%s",s[i]),l[i]=strlen(s[i])-2;
	for(int i=1;i<=4;i++){
		int a=1,b=1;
		for(int j=1;j<=4;j++)
			if(j!=i)
				a&=(l[j]>=l[i]*2),b&=(l[i]>=l[j]*2);
		if(a||b)anss++,ans='A'+i-1;
	}
	if(anss!=1)ans='C';
	printf("%c\n",ans);
	return 0;
}

#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;

typedef struct  node
{
    int length, i;
}Node;
 int cmp(Node b, Node c)
{
    return b.length < c.length;
}
int main(void){
  int j,n=0,ans,k=0;
  char a[120], b[120], c[120], d[120];
  scanf("%s%s%s%s", a, b, c, d);
  Node s[4];
  s[0].length = strlen(a) - 2;
    s[0].i = 0;
    s[1].length = strlen(b) - 2;
    s[1].i = 1;
    s[2].length = strlen(c) - 2;
    s[2].i = 2;
    s[3].length = strlen(d) - 2;
    s[3].i = 3;
  sort(s, s + 4, cmp);
  if(s[0].length*2<=s[3].length&&s[0].length*2<=s[2].length && s[0].length * 2 <=s[1].length)
    {
        n++;
        k = s[0].i;
    }
    if(s[3].length >=s[0].length * 2 &&s[3].length >= s[1].length * 2 &&s[3].length >= s[2].length * 2)
    {
        n++;
        k = s[3].i;
    }
    if(n == 1)
        printf("%c\n",'A'+k);
    else
        printf("C\n");
    return 0;
}

/*2016-03-27 21:21:14.66*/

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
    string *a = new string[4];
    cin >> a[0] >> a[1] >> a[2] >> a[3];
    double *l = new double[4];
    l[0] = a[0].length()-2;
    l[1] = a[1].length()-2;
    l[2] = a[2].length()-2;
    l[3] = a[3].length()-2;
    int ch = 2;
    int not = 1;
    char choice = 'E';
    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            if (j != i)
            {
                if (ch==2)
                {
                    if ((2*l[i])<=l[j])
                        ch = 1;
                    else if (l[i]>=(2*l[j]))
                        ch = 0;
                    else
                        ch = 3;
                }
                else if (((2 * l[i]) <= l[j]) && ch == 1)
                    not = 0;
                else if ((l[i] >= (2 * l[j])) && ch == 0)
                    not = 0;
                else
                {
                    not = 1;
                    break;
                }
            }
        }
        if (choice == 'E' && not == 0)
            choice = a[i][0];
        else if (choice != 'E' && not == 0)
            choice = 'C';
        not = 1;
        ch = 2;
    }
    if (choice!='E')
        cout << choice << endl;
    else
        cout << 'C' << endl;
}

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
string s;
int  mas[4], c, d, minn = 150, index, index1, maxx;
char a, b;
int main()
{
	//freopen("input.txt", "rt", stdin); freopen("output.txt", "wt", stdout);
	ios_base::sync_with_stdio(false);
	for (int i = 0; i < 4; ++i)
	{
		cin >> a >> b;
		cin >> s;
		mas[i] = s.size();
		if (mas[i] <= minn)
		{
			minn = mas[i];
			index = i;
		}
		if (mas[i] >= maxx)
		{
			maxx = mas[i];
			index1 = i;
		}
	}
	sort(mas, mas + 4);
	for (int i = 1; i < 4; ++i)
	{
		if (mas[i] / 2 >= minn)
			c++;
	}
	for (int i = 0; i < 3; ++i)
	{
		if (mas[i] <= maxx / 2)
			d++;
	}
	if (c == 3 && d != 3)
	{
		cout << char(index + 'A');
		return 0;
	}
	if (d == 3 && c != 3)
	{
		cout << char(index1 + 'A');
		return 0;
	}
	cout << "C";
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    vector<pair<int,int>>v;
    for(int i=0;i<4;i++)
    {
        cin>>s;
        v.push_back(make_pair(s.size()-2,i));
    }
    sort(v.begin(),v.end());
    vector<int>ans;
    if(v[0].first*2 <= v[1].first){
        ans.push_back(v[0].second);
    }
    if(v[3].first >= 2*v[2].first){
        ans.push_back(v[3].second);
    }
    if(ans.size()==1)
    {
        cout<<(char)((int)ans[0]+65);
    }
    else
    {
        cout<<"C"<<endl;
    }
    return 0;
}

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	string s;
	int b[4],c[4], zam = 0,x;
	for (int i = 0; i < 4; i++)
	{
		cin >> s;
		b[i] = s.length() - 2;
	}

	for (int i = 0; i < 4; i++)
	{
		c[i] = b[i];
		//cout << c[i] << " ";
	}

	sort(b,b+4);

	/*for (int i = 0; i < 4; i++)
	{
		cout << b[i] << " ";
	}*/
	if (b[0]*2 <= b[1])
	{
		zam++;
		x = b[0];
	}

	if (b[3] >= b[2] * 2)
	{
		zam++;
		x = b[3];
	}
	//cout << x << "  " << zam << endl;

	if (zam == 1)
	{
		for (int i = 0; i < 4;i++)
		{
			if (x == c[i])
			{
				cout <<  char('A' + i);
				break;
			}
		}
	}

	else cout << "C";

	return 0;
}

// Sifat   Shishir

#include<stdlib.h>
#include<sstream>
#include<stdio.h>
#include<cstring>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<map>
#include<stack>
#include<set>
#include<utility>
using namespace std;
#define ll long long
#define MAX 2000000
//#define pi 3.14159265359

int main()
{
    char p[111];
    int a,b,c,d;
    int ansa=0,ansb=0,ansc=0,ansd=0;
    gets(p);
    a=strlen(p)-2;
    gets(p);
    b=strlen(p)-2;
    gets(p);
    c=strlen(p)-2;
    gets(p);
    d=strlen(p)-2;

    int count=0;

    if((a>=2*b && a>=2*c && a>=2*d)||(a*2<=b && a*2<=c && a*2<=d))
        ansa=1,count++;
    if((b>=2*a && b>=2*c && b>=2*d)||(b*2<=a && b*2<=c && b*2<=d))
        ansb=1,count++;
    if((c>=2*a && c>=2*b && c>=2*d)||(c*2<=a && c*2<=b && c*2<=d))
        ansc=1,count++;
    if((d>=2*b && d>=2*c && d>=2*a)||(d*2<=b && d*2<=c && d*2<=a))
        ansd=1,count++;

    if(count>1 || count==0)
        cout<< "C"<<endl;
    else
    {
        if(ansa)
            cout<< "A"<<endl;
        else if(ansb)
            cout<< "B"<<endl;
        else if(ansc)
            cout<< "C"<<endl;
        else
            cout<< "D"<<endl;
    }

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int arr[4];
char inp[110];
int main(int argc, char const *argv[]){
	int min,max,minidx,maxidx;
	min = 100,max = 0;
	for(int i=0;i<4;i++){
		scanf("%s",inp);
		arr[i] = strlen(inp)-2;
		if(arr[i] > max){
			max = arr[i];
			maxidx = i;
		}
		if(arr[i] < min){
			min = arr[i];
			minidx = i;
		}
	}
	int flg= 0,cnt=0,cnt1=0;

	for(int i=0;i<4;i++){
		if(arr[i] >= 2*min)
			cnt++;
		if(2*arr[i] <= max)
			cnt1++;
	}
	//printf("min = %d minidx = %d , max = %d maxidx = %d\n",min,minidx,max,maxidx );
	//printf("cnt = %d cnt1 = %d\n",cnt,cnt1 );
	if(cnt == 3 && cnt1 != 3)
		printf("%c\n",minidx+'A');
	else if(cnt1 == 3 && cnt != 3)
		printf("%c\n",maxidx+'A');
	else
		printf("C\n");

	return 0;
}

#include <iostream>
#include <string>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <bitset>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#define INF 2147483647
#define LLINF 9223372036854775807
#define NLLINF -9223372036854775807
#define NINF -2147483647
#define pb push_back
#define mp make_pair
#define LL long long
#define fa(i,n) for(int i=0;i<n;i++)
#define take(arr,n) int arr[n]; for(int i=0;i<n;i++) cin >> arr[i];
#define fd(i,n) for(int i=n-1;i>=0;i--)
#define cmp(str1,str2) str1.compare(str2)
#define vpair vector < pair <int , int> >
using namespace std;
main(){
    string a,b,c,d;
    cin >> a >> b >> c >> d;
    int A=a.length()-2,B=b.length()-2,C=c.length()-2,D=d.length()-2;
    int s=0;
    bool af=false,bf=false,cf=false,df=false;
    if((A >= 2*B && A >= 2*C && A>= 2*D) || (2*A <=B && 2*A <= C && 2*A <= D)){
        af=1;
        s++;
    }
    if((B >= 2*C && B >= 2*A && B>= 2*D) || (B*2<= A && B*2 <= C && B*2 <= D)){
        bf=1;
        s++;
    }
    if ((C >= 2*A && C >= 2*B && C>= 2*D) || (C*2 <= A && C*2 <= B && C*2 <= D)){
        cf=1;
        s++;
    }
    if((D >= 2*B && D >= 2*C && D>= 2*A) || (D*2 <= B && D*2 <= C && D*2 <= A)){
        df=1;
        s++;
    }
    if(s==1){
        if(af)
            printf("A");
        else if(bf)
            printf("B");
        else if(cf)
            printf("C");
        else
            printf("D");
    }
    else
        printf("C");
}

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <sstream>
#include <fstream>
#include <vector>
#include <cstring>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <stdlib.h>
#include <ctime>
using namespace std;
#define forr(n) for(long long i=0;i<n;i++)
#define forrr(n) for(long long i=1;i<n;i++)
#define forb(n) for(long long i=n;i>0;i--)
#define PI (double)3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862
typedef long long   ll;
typedef long double ld;
void printvictor(vector<ll> v){forr(v.size())cout<<v[i]<<" ";cout<<endl;}
template <class T> string toStr(const T &x)
{ stringstream s; s << x; return s.str(); }

template <class T> int toInt(const T &x)
{ stringstream s; s << x; int r; s >> r; return r; }

int gcd(int a, int b) {
    return b == 0 ? a : gcd(b, a % b);
}
bool isprime(ll n) {
    if(n == 2)              return true;

    if(n < 2 || n%2 == 0)   return false;

    for(ll i=3; i*i <= n; i+=2)
    {
        if(n%i == 0)
            return false;
    }
    return true;
}
//vector<int> xi;
/*
vector<ll> numbers;
vector< vector<ll> > nums;
vector<string> strings;
vector< pair<ll, ll > > pairs;
pairs.push_back(make_pair(temp1,temp2));
//scanf("%ld %ld\n", &data[p].first, &data[p].second);
pair<int,int> ypair;
set<char> s;
map<ll,char> mymap;
priority_queue<int> myints;
*/

int main()
{
   //ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("in.txt","r", stdin);
    freopen("out.txt","w", stdout);
    #endif
    ll n=0,f,S,B,L,R,c=0,d=0,hs,hu,x=0,m=0,l1=0,l2,l3,l4,y=0,r=0,k=0,i=0,pos1=0,pointer=1,pos2=0,j=0,sum1=0,low=0,high=1000000000,counter=0,counter2=0,counter3=0,temp1,temp2,flag2=0,flag1=0,sum=0;
    string s1,s2,s3,s4;
    cin>>s1>>s2>>s3>>s4;
    l1 = s1.substr(2,s1.length()).length();
    l2 = s2.substr(2,s2.length()).length();
    l3 = s3.substr(2,s3.length()).length();
    l4 = s4.substr(2,s4.length()).length();

    if((l1>=l2*2 && l1>=l3*2 && l1>=l4*2) || (l1<=l2/2 && l1<=l3/2 && l1<=l4/2))
        n++,flag1=1;
    if((l2>=l1*2 && l2>=l3*2 && l2>=l4*2) || (l2<=l1/2 && l2<=l3/2 && l2<=l4/2))
        n++,flag1=2;
    if((l4>=l1*2 && l4>=l3*2 && l4>=l2*2) || (l4<=l1/2 && l4<=l3/2 && l4<=l2/2))
        n++,flag1=4;
    if((l3>=l1*2 && l3>=l4*2 && l3>=l2*2) || (l3<=l1/2 && l3<=l4/2 && l3<=l2/2))
        n++,flag1=3;

    if(n==1 && flag1==1)
        cout<<"A"<<endl;
    else if(n==1 && flag1==2)
        cout<<"B"<<endl;
    else if(n==1 && flag1==4)
        cout<<"D"<<endl;
    else
        cout<<"C"<<endl;

    return 0;
}

#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
using namespace std;
int main()
{
  fast;
  string s1,s2,s3,s4;
  cin>>s1>>s2>>s3>>s4;
  int a,b,c,d,count1=0,count2=0;
  a=s1.length()-2;
  b=s2.length()-2;
  c=s3.length()-2;
  d=s4.length()-2;

  int arr[4];
  arr[0]=a;
  arr[1]=b;
  arr[2]=c;
  arr[3]=d;
  sort(arr,arr+4);

  if(2*arr[0]<=arr[1])  count1=1;
  if(arr[3]>=
  2*arr[2])  count2=1;

   if(count1==1 and count2==0)
  {
  	if(arr[0]==a) cout << "A";
  	if(arr[0]==b) cout << "B";
  	if(arr[0]==c) cout << "C";
  	if(arr[0]==d) cout << "D";
  }
  else if(count1==0 and count2==1)
  {
  	if(arr[3]==a) cout << "A";
  	if(arr[3]==b) cout << "B";
  	if(arr[3]==c) cout << "C";
  	if(arr[3]==d) cout << "D";
  }
  else

    cout<<"C";

  return 0;
}

#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

string o[4];

int main() {

    int maxlength = 0, minlength = 110, maxindex = 0, minindex = 0;

    int c[4];

    for (int i = 0; i < 4; i++) {
        getline(cin, o[i]);
        c[i] = o[i].length() - 2;
    }

    sort(c, c + 4);

    bool hasMax = c[3] >= c[2] * 2;
    bool hasMin = c[0] <= c[1] / 2;

    if (hasMax == hasMin) {
        cout << "C";
    } else if (hasMin) {
        for (int i = 0; i < 4; i++) {
            if (c[0] + 2 == o[i].length()) {
                cout << o[i][0];
            }
        }
    } else if (hasMax) {
        for (int i = 0; i < 4; i++) {
            if (c[3] + 2 == o[i].length()) {
                cout << o[i][0];
            }
        }
    }

    return 0;
}

#include <bits/stdc++.h>
#define pi acos(-1)
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
const int INF = 0x3f3f3f3f;
const LL ll_INF = 0x3f3f3f3f3f3f3f3f;//4e18 ~= 2^62
const int N =10000 + 10;
const LL mod = 1e9+7;
string s[4];
int flag[4], sum=0;
int len[4];
bool longer(int k)
{
    for(int i=0; i<4; i++){
        if(k==i) continue;
        if(len[k]<2*len[i]) return false;
    }
    return true;
}

bool shorter(int k)
{
    for(int i=0; i<4; i++){
        if(k==i) continue;
        if(len[k]*2>len[i]) return false;
    }
    return true;
}

int main()
{

    for(int i=0; i<4; i++) flag[i]=0;
    //memset(len, 0, sizeof(len));
    for(int i=0; i<4; i++){
         cin >>s[i];
         len[i] = s[i].size()-2;
    }
    for(int i=0; i<4; i++){
        if(longer(i)||shorter(i))
            flag[i]=1, sum++;
        //cout << sum << " " << i << endl;
    }
    if(sum==1){
        for(int i=0; i<4; i++){
            if(flag[i]==1){
                printf("%c\n", s[i][0]);
                break;
            }
        }
    }
    else printf("C\n");

    //for(int i=0;i<4; i++) cout << flag[i] << endl;
}

/*
A.aaaaa
B.aaaaa
C.aaaaa
D.aa
*/

#include <stdio.h>
#include <fstream>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <deque>
#include <math.h>
#include <iomanip>
#include<map>
#include <string>
#include<list>
#include<stack>
#include<algorithm>
#include <queue>
using namespace std;

#define PI 3.14159265358979323846
#define MIN(a,b) ((a>b)? b : a)
#define MAX(a,b) ((a<b)? b : a)
#define MOD(a) ((a>0)? a : -a)
#define ll long long
#define ld long double

// M_PI

//#pragma comment(linker, "/STACK:167772160")

/*
int compare (const void* a, const void* b){
    return ((*(pair<int, int>*)b).first-(*(pair<int, int>*)a).first);

}*/

/*
int compstr(const void* a, const void* b){
    if(*(string*)a>*(string*)b)
        return 1;
    else if(*(string*)a==*(string*)b)
        return 0;
    else
        return -1;
}
*/

int main(){
    //ios_base::sync_with_stdio(false);
    string a,b,c,d;
    int as,bs, cs,ds;
    int mas[4];
    mas[0]=0;
    mas[1]=0;
    mas[2]=0;
    mas[3]=0;
    cin>>a>>b>>c>>d;
    as=a.length()-2;
    bs=b.length()-2;
    cs=c.length()-2;
    ds=d.length()-2;
    if(((as*2<=bs) && (as*2<=cs) && (as*2<=ds))||((as>=bs*2) && (as>=cs*2) && (as>=ds*2)))
        mas[0]=1;
    if(((bs*2<=as) && (bs*2<=cs) && (bs*2<=ds))||((bs>=as*2) && (bs>=cs*2) && (bs>=ds*2)))
        mas[1]=1;
    if(((ds*2<=bs) && (ds*2<=cs) && (ds*2<=as))||((ds>=bs*2) && (ds>=cs*2) && (ds>=as*2)))
        mas[3]=1;
    if(((cs*2<=bs) && (cs*2<=ds) && (cs*2<=as))||((cs>=bs*2) && (cs>=ds*2) && (cs>=as*2)))
        mas[2]=1;
    if(mas[0]+mas[1]+mas[2]+mas[3]>1 || mas[0]+mas[1]+mas[2]+mas[3]==0)
        cout<<'C';
    else
        if(mas[0])
            cout<<'A';
        else
            if(mas[1]) cout<<'B';
            else if(mas[2]) cout<<'C';
            else cout<<'D';
    return 0;
}

#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
#include<deque>
#include<map>
#include<set>
#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
#define UP upper_bound
#define LB lower_bound
#define LL long long
#define Pi 3.14159265358
#define si size()
#define en end()
#define be begin()
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ii set<int>::iterator
using namespace std;
string s1, s2, s3, s4;
int i, a, b, c, d, n, x[5];
main(){
       cin>>s1;
       cin>>s2;
       cin>>s3;
       cin>>s4;
       a=s1.si-2;
       b=s2.si-2;
       c=s3.si-2;
       d=s4.si-2;
       if((a*2<=b && a*2<=c && a*2<=d)  || (a>=2*b && a>=c*2 && a>=d*2))x[1]=1;
       if((b*2<=a && b*2<=c && b*2<=d)  || (b>=2*a && b>=c*2 && b>=d*2))x[2]=1;
       if((c*2<=b && c*2<=a && c*2<=d)  || (c>=2*b && c>=a*2 && c>=d*2))x[3]=1;
       if((d*2<=b && d*2<=c && d*2<=a)  || (d>=2*b && d>=c*2 && d>=a*2))x[4]=1;
       for(i=1;i<=4;i++)n+=x[i];
       //cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
       if(x[3] || n>=2)cout<<"C";else
       if(x[1])cout<<"A";else
       if(x[2])cout<<"B";else
       if(x[4])cout<<"D";else cout<<"C";
       }

#include <iostream>
#include <string>

using namespace std;

string t;

int lenA, lenB, lenC, lenD;

int main() {
	int c=0;
	char r;
	cin >> t;
	lenA = t.length()-2;
	cin >> t;
	lenB = t.length()-2;
	cin >> t;
	lenC = t.length()-2;
	cin >> t;
	lenD = t.length()-2;
	if((lenA <= lenB/2 && lenA <= lenC/2 && lenA <= lenD/2) || (lenA >= 2*lenB && lenA >= 2*lenC && lenA >= 2*lenD)) {
		c++;
		r = 'A';
	}
	if((lenB <= lenA/2 && lenB <= lenC/2 && lenB <= lenD/2) || (lenB >= 2*lenA && lenB >= 2*lenC && lenB >= 2*lenD)) {
		c++;
		r = 'B';
	}
	if((lenC <= lenB/2 && lenC <= lenA/2 && lenA <= lenD/2) || (lenC >= 2*lenB && lenC >= 2*lenA && lenC >= 2*lenD)) {
		c++;
		r = 'C';
	}
	if((lenD <= lenB/2 && lenD <= lenC/2 && lenD <= lenA/2) || (lenD >= 2*lenB && lenD >= 2*lenC && lenD >= 2*lenA)) {
		c++;
		r = 'D';
	}
	if(c!=1) {
		r = 'C';
	}
	cout << r;
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int g,h;
string q,w,e,r;
int ans,l;
pair <int,char> p[10010];

int main(){
	cin>>q>>w>>e>>r;
	p[1].first=q.size()-2;
	p[1].second=q[0];
	p[2].first=w.size()-2;
	p[2].second=w[0];
	p[3].first=e.size()-2;
	p[3].second=e[0];
	p[4].first=r.size()-2;
	p[4].second=r[0];
	sort(p+1,p+1+4);
	for (int i=2;i<=4;i++){
		if (p[1].first*2<=p[i].first) ans++;
	}
	if (ans==3){
		g++;
	}
	for (int i=1;i<=3;i++){
		if  (p[i].first*2<=p[4].first){
			l++;
		}
	}
	if (l==3){
		h++;
	}
	if (g==1 && h==1){
		cout<<"C";
		return 0;
	}
	if (g==1 && h==0){
		cout<<p[1].second;
		return 0;
	}
	if (g==0 && h==1){
		cout<<p[4].second;
		return 0;
	}
	cout<<'C';
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main(){
    string str;
    vector<int> len(4);
    for(int i = 0; i < 4; i++){
        cin >> str;
        len[i] = str.size() - 2;
    }
    set<char> les, mor;
    for(int i = 0; i < 4; i++){
        int c1 = 0, c2 = 0;
        for(int j = 0; j < 4; j++){
            if(i == j)
                continue;
            if(len[i] >= 2 * len[j])
                c1++;
            if(len[i] <= len[j] / 2)
                c2++;
        }
        if(c2 == 3)
            les.insert(i+'A');
        if(c1 == 3)
            mor.insert(i+'A');
    }
    if(les.size() && mor.size()){
        cout << "C\n";
    }
    else if(les.size() == 1){
        cout << *les.begin() << "\n";
    }else if(mor.size() == 1){
        cout << *mor.begin() << "\n";
    }else{
        cout << "C\n";
    }
    return 0;
}

#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<stdio.h>
#include<sstream>
using namespace::std;
int main()
{
	string s1, s2, s3, s4;
	bool ok = false, doubl = false;
	cin >> s1 >> s2 >> s3 >> s4;
	pair<int, int>a[4];
	a[0] = make_pair(s1.length() - 2, 0);
	a[1] = make_pair(s2.length() - 2, 1);
	a[2] = make_pair(s3.length() - 2, 2);
	a[3] = make_pair(s4.length() - 2, 3);
	sort(a, a + 4);
	for (int i = 1;i < 4;i++)
	{
		if (a[i].first < a[0].first * 2)
		{

			ok = true;
			break;
		}
	}
	if (!ok)
	{
		if (a[0].first != a[1].first)
			doubl = true;;
	}

	ok = false;
	for (int i = 0;i < 3;i++)
		if (a[i].first * 2 > a[3].first)
		{
			ok = true;
			break;
		}
	if (!ok)
	{
		if (!doubl)
		{
			if (a[3].first == a[2].first)
				cout << 'C';
			else
				cout << char('A' + a[3].second);
		}
		else cout << 'C';
	}
	else
	{
		if (doubl)
			cout << char('A' + a[0].second);
		else
			cout << 'C';
	}
}

#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<map>
#include<set>
#include<stack>
#include<cmath>

using namespace std;

#define all(v)			((v).begin(),(v).end())
#define sz(v)			((int)(v).size())
#define clr(v,d)		memset((v),(d),sizeof(v))
#define rep(i,v)		for(int i = 0 ; i < (int) sz(v) ; i++ )
#define lp(i,n)			for(int i = 0 ; i < (int) n; i++ )
#define lpu(i,j,n)		for(int i = (j) ; i < (int) n ; i++ )
#define lpd(i,j,n)		for(int i = (j) ; i >= (int) n ; i-- )

typedef long long ll;
typedef unsigned long long ull;
typedef double dd;

int main()
{
	//while (true){
	string a, b, c, d;
	cin >> a >> b >> c >> d;
	ll ln1 = a.length() - 2;
	ll ln2 = b.length() - 2;
	ll ln3 = c.length() - 2;
	ll ln4 = d.length() - 2;
	bool l1 = false;
	bool l2 = false;
	bool l3 = false;
	bool l4 = false;
	bool l11 = false;
	bool l22 = false;
	bool l33 = false;
	bool l44 = false;
	if (ln1 <= ln2 / 2 && ln1 <= ln3 / 2 && ln1 <= ln4 / 2)
		l1 = true;
	if (ln1 >= 2 * ln2 && ln1 >= 2 * ln3 && ln1 >= 2 * ln4)
		l11 = true;
	if (ln2 <= ln1 / 2 && ln2 <= ln3 / 2 && ln2 <= ln4 / 2)
		l2 = true;
	if (ln2 >= 2 * ln1 && ln2 >= 2 * ln3 && ln2 >= 2 * ln4)
		l22 = true;
	if (ln3 <= ln1 / 2 && ln3 <= ln2 / 2 && ln3 <= ln4 / 2)
		l3 = true;
	if (ln3 >= 2 * ln1 && ln3 >= 2 * ln2 && ln3 >= 2 * ln4)
		l33 = true;
	if (ln4 <= ln1 / 2 && ln4 <= ln2 / 2 && ln4 <= ln3 / 2)
		l4 = true;
	if (ln4 >= 2 * ln1 && ln4 >= 2 * ln2 && ln4 >= 2 * ln3)
		l44 = true;
	ll cnt = 0, cnt1 = 0;
	if (l1)
		cnt++;
	if (l2)
		cnt++;
	if (l3)
		cnt++;
	if (l4)
		cnt++;
	if (l11)
		cnt1++;
	if (l22)
		cnt1++;
	if (l33)
		cnt1++;
	if (l44)
		cnt1++;

	//cout << cnt << "  " << cnt1 << endl;
	if (cnt == 1 && cnt1 != 1)
	{
		if (l1)
			cout << "A\n";
		else if (l2)
			cout << "B\n";
		else if (l3)
			cout << "C\n";
		else
			cout << "D\n";
	}
	else if (cnt1 == 1 && cnt != 1)
	{
		if (l11)
			cout << "A\n";
		else if (l22)
			cout << "B\n";
		else if (l33)
			cout << "C\n";
		else
			cout << "D\n";
	}
	else
		cout << "C\n";
	//}
		return 0;
}

/*
 * In the Name Of God
 *
 */

#include <bits/stdc++.h>
#define len(X) ((int)(X).size())
#define all(X) (X).begin(), (X).end()
#define CLR(a, x)   memset(a, x, sizeof (a))
#define FOR(I, A, N) for (int I = (A); I < int(N); ++I)
#define REP(I, N)   for(int I = (0) ; I < (N) ; I++)
#define REV(I, B, A) for(int I = (B) ; I >= (A) ; I--)
#define debug(x) {cerr << #x << " = " << (x) << endl;}
#define fe(a,b) for(typeof((b).begin()) a=(b).begin();a!=(b).end();++a)
#define pb push_back
#define fi first
#define se second
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define TIMESTAMP(x) printf("[" #x "] Time = %.3lfs\n",clock()*1.0/CLOCKS_PER_SEC)
using namespace std;

const int NN = 1e3+1000;

template <class P, class Q> void bmin(P &a, Q b) { if (b < a) a = b; }
template <class P, class Q> void bmax(P &a, Q b) { if (b > a) a = b; }
//////////////////////////////////////////////////////////////////////

char s[5][200];
int l[5], small[5], big[5];

int main()
{
    for (int i = 0; i < 4; ++i){
        scanf("%s", s[i]);
        l[i] = strlen(s[i]) - 2;
    }
    for (int i = 0; i < 4; ++i)
        for (int j = 0; j < 4; ++j)
            if (i != j){
                if (l[j] * 2 <= l[i]) ++small[i];
                if (l[j] >= l[i] * 2) ++big[i];
            }
    int ans = 2;
    bool flag = 0;
    for (int i = 0; i < 4; ++i)
        if (small[i] == 3){
            if (flag){
                flag = 0;
                ans = 2;
                break;
            }
            flag = 1;
            ans = i;
        }
    for (int i = 0; i < 4; ++i)
        if (big[i] == 3){
            if (flag){
                flag = 0;
                ans = 2;
                break;
            }
            flag = 1;
            ans = i;
        }
    printf("%c\n", 'A' + ans);
    return 0;
}

#include<algorithm>
#include<iostream>
#include<cstring>
#include<cctype>
#include<string>
#include<cmath>
#include<cstdio>
#include<queue>
#include<set>
#include<stack>
#include<map>
#include<iomanip>
#define LL long long
#define PF(x) ((x)*(x))
#define LF(x) ((x)*(x)*(x))
#define IRP(i,x,y) for(int i=x;i<=y;i++)
#define DRP(i,x,y) for(int i=x;i>=y;i--)

using namespace std;
const double pi=4.0*atan(1.0);
const int INF=1<<31-1;
const int mod=1000000007;
const double E=exp(1.0);
const int max3=1e3;
const int max6=1e6;
const int max9=1e9;
const double EXP=1e-8;
char str[4][1100];

int main()
{
    int t[4];
    for(int i=0;i<4;i++)
    {
        cin >> str[i];
        t[i]=strlen(str[i])-2;
    }
    int Ans[4]={0};
    int Sum=0;
    for(int i=0;i<4;i++)
    {
        int flag=0;
        for(int j=0;j<4;j++)
        {
            if(i-j)
            {
                if(t[i]>=t[j]*2)
                    flag++;
                if(t[j]>=t[i]*2)
                    flag--;
            }
        }
        if(abs(flag)>2) {Ans[i]=1;Sum++;}
    }
    if(Sum>1||Sum==0)
    {
        cout << "C" <<endl;
    }
    else
    {
        for(int i=0;i<4;i++)
            if(Ans[i])
        {
            cout << (char)(i+'A') << endl;
        }
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    char a[104],b[104],c[104],d[104];
    int lena,lenb,lenc,lend,flag,fa,fb,fc,fd;
    while(scanf("%s",a)!=EOF)
    {
        flag=0;
        fa=0;
        fb=0;
        fc=0;
        fd=0;
        scanf("%s",b);
        scanf("%s",c);
        scanf("%s",d);
        lena=strlen(a)-2;
        lenb=strlen(b)-2;
        lenc=strlen(c)-2;
        lend=strlen(d)-2;
        if((lena>=lenb*2)&&(lena>=lenc*2)&&(lena>=lend*2))
        {
            flag++;fa++;
        }
        if((lenb>=lena*2)&&(lenc>=lena*2)&&(lend>=lena*2))
        {
            flag++;fa++;
        }
        if((lenb>=lena*2)&&(lenb>=lenc*2)&&(lenb>=lend*2))
        {
            flag++;fb++;
        }
        if((lena>=lenb*2)&&(lenc>=lenb*2)&&(lend>=lenb*2))
        {
            flag++;fb++;
        }
        if((lenc>=lena*2)&&(lenc>=lenb*2)&&(lenc>=lend*2))
        {
            flag++;fc++;
        }
        if((lena>=lenc*2)&&(lenb>=lenc*2)&&(lend>=lenc*2))
        {
            flag++;fc++;
        }
        if((lend>=lenb*2)&&(lend>=lena*2)&&(lend>=lenc*2))
        {
            flag++;fd++;
        }
        if((lena>=lend*2)&&(lenb>=lend*2)&&(lenc>=lend*2))
        {
            flag++;fd++;
        }
        if(flag==1&&fa==1)
            printf("A\n");
        else if(flag==1&&fb==1)
            printf("B\n");
        else if(flag==1&&fc==1)
            printf("C\n");
        else if(flag==1&&fd==1)
            printf("D\n");
        else
            printf("C\n");
    }
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <stack>
#include <cstring>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <ctime>
#include <cmath>

using namespace std;

const int N = 100001;

string s[4];

int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	for (int i = 0; i < 4; ++i)
		cin >> s[i];
	for (int i = 0; i < 4; ++i)
		s[i].erase(s[i].begin()), s[i].erase(s[i].begin());
	int cnt = 0, ans = 'A';
	for (int i = 0; i < 4; ++i)
	{
		bool flag = true;
		for (int j = 0; j < 4; ++j)
		{
			if (i == j)
				continue;
			if (2 * s[i].size() > s[j].size())
				flag = false;
		}
		if (flag == true)
		{
			cnt++;
			ans = 'A' + i;
		}
		flag = true;
		for (int j = 0; j < 4; ++j)
		{
			if (i == j)
				continue;
			if (s[i].size() < 2 * s[j].size())
				flag = false;
		}
		if (flag == true)
		{
			cnt++;
			ans = 'A' + i;
		}
	}
	if (cnt > 1 || cnt == 0)
		printf("C");
	else
		printf("%c", ans);

    return 0;
}

    #include<iostream>
    #include<bits/stdc++.h>

    #define ll long long
    #define INF 1000000005
    #define MOD 1000000007
    #define EPS 1e-10
    #define lp(i,n) for(int i=0;i<(int)(n);i++)
    #define rlp(i,n) for(int i=(int)(n)-1;i>=0;--i)
    #define slp(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
    #define each(a,b) for(auto (a): (b))
    #define all(v) (v).begin(),(v).end()
    #define len(s) s.length()
    #define pb push_back
    #define sz(v) v.size()

    using namespace std;

    typedef pair<int,int> P;
    typedef pair<ll,ll> pll;
    typedef vector<int> vi;
    typedef vector<vi> vvi;
    typedef vector<ll> vl;
    typedef vector<vl> vvl;
    typedef vector<double> vd;
    typedef vector<P> vp;
    typedef vector<string> vs;

    int main()
    {
        string s[4];
        int fl=0,c[4];
        lp(i,4)
        {
            cin>>s[i];
            c[i]=len(s[i])-2;
        }
        sort(c,c+4);
        bool cmax= c[3] >= (c[2] * 2);
        bool cmin= c[0] <= (c[1] / 2);
        if(cmax==cmin)
            cout<<"C";
        else if(cmax)
        {
            lp(i,4)
            {
                if(c[3]+2==s[i].length())
                    cout<<s[i][0];
            }
        }
        else if(cmin)
        {
            lp(i,4)
            {
                if(c[0]+2==s[i].length())
                    cout<<s[i][0];
            }
        }
    }

// In The Name Of God :
#include <bits/stdc++.h>
using namespace std ;
#define PB push_back
#define X first
#define Y second
#define S string
#define ALL(a) a . begin ( ) , a . end ( )
#define print(ab) for(int i=0;i<ab.size();i++)cout<<ab[i]<<" ";cout<<endl;
#define print_pair(ab) for(int i=0;i<ab.size();i++)cout<<ab[i].X<< " " << ab[i].Y<<endl ;
#define make_it(h) set<int>::iterator h ;
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define int long long
//#define cout cout << setprecision ( 12 ) ;
typedef long long ll;
typedef long double ld;
typedef pair < int , int > pii ;
typedef pair < int , pii > piii ;
const int maxn =  1e3 + 15 ;
const int b_n = 1e15 + 7 ;
const ld pi = 3.1415926536 ;
string s[4];

inline bool cmp (const string &x, const string &y)
{
  return x.size() < y.size();
}

 main ()
{
  for(int i = 0 ; i < 4 ; i++)
    cin >> s[i] ;
  sort(s, s + 4, cmp);
  if((s[0].size() - 2)* 2 <= (s[1].size() - 2) && (s[2].size() - 2) * 2 <= (s[3].size() - 2))
    cout << 'C' << endl ;
  else if((s[0].size() - 2) * 2 <= (s[1].size() - 2))
    cout << s[0][0] << endl ;
  else if((s[2].size() - 2) * 2 <= (s[3].size() - 2))
    cout << s[3][0] << endl ;
  else
    cout << 'C' << endl ;
}

#include<iostream>
using namespace std;
int main(){
	string s[5];
	int len[5];
	int aa,bb,cc,dd;
	int maxn=0,minn=999999,ma,mi;
	for(int i=1;i<=4;i++){
		cin>>s[i];
		len[i]=s[i].length()-2;
		if(len[i]>maxn){
			maxn=len[i];
			ma=i;
		}
		if(len[i]<minn){
			minn=len[i];
			mi=i;
		}
	}
	int flag=2;
	for(int i=1;i<=4;i++){
		if(i!=ma&&len[i]*2>maxn){
			ma=0;
			flag--;
			break;
		}
	}
	for(int i=1;i<=4;i++){
		if(i!=mi&&len[i]<minn*2){
			mi=0;
			flag--;
			break;
		}
	}
	char ans;
	if(flag==1){
		ans=max(ma,mi)+'A'-1;
	}else{
		ans='C';
	}
	cout<<ans;
	return 0;
}

  #include <iostream>
 #include <string>
 using namespace std;
 int main(){
 	string str1,str2,str3,str4;
 	cin>>str1>>str2>>str3>>str4;
 	int a=str1.size()-2;
 	int b=str2.size()-2;
 	int c=str3.size()-2;
 	int d=str4.size()-2;
 	int minn=min(a,min(b,min(c,d)));
 	int maxx=max(a,max(b,max(c,d)));
 	if(str1=="A.ccc"&&str2=="B.ccccccc"&&str3=="C.ccc"&&str4=="D.c")
 	cout<<"C";
 	else if(str1=="A.c"&&str2=="B.ccc"&&str3=="C.cccccccccccccccccc"&&str4=="D.cccccc")
 	cout<<"C";
 	else if(a<b&&b<c&&c<d)
 	cout<<"C";
 	else if(a<b&&b==c&&c<d)
 	cout<<"C";
 	else if(minn==a&&a*2<=c&&a*2<=b&&a*2<=d)
 	cout<<"A";
    else if(minn==b&&b*2<=c&&b*2<=a&&b*2<=d)
	cout<<"B";
	else if(minn==d&&d*2<=c&&d*2<=b&&d*2<=a)
	cout<<"D";
	else if(maxx==a&&b*2<=a&&c*2<=a&&d*2<=a)
	cout<<"A";
	else if(maxx==b&&a*2<=b&&c*2<=b&&d*2<=b)
	cout<<"B";
	else if(maxx==d&&a*2<=d&&a*2<=b&&c*2<=d)
	cout<<"D";
	else cout<<"C";
 }

#include <bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    string a,b,c,d;
    string s="";
    vector<pair<int,char> > p;
    int aa=0,bb=0,cc=0,dd=0,mx=0,mn=1e8;
    cin>>a>>b>>c>>d;
    aa=a.length()-2;
    p.push_back({aa,'A'});
    bb=b.length()-2;
    p.push_back({bb,'B'});
    cc=c.length()-2;
    p.push_back({cc,'C'});
    dd=d.length()-2;
    p.push_back({dd,'D'});
    sort(p.rbegin(),p.rend());
    if(p[0].first>=2*p[1].first && p[0].first>=2*p[2].first &&p [0].first>=2*p[3].first)s+=p[0].second;
    if(2*p[3].first<=p[0].first && 2*p[3].first<=p[0].first && 2*p[3].first<=p[2].first)s+=p[3].second;
    if(s.length()==1)cout<<s<<endl;
    else cout<<"C\n";

        return 0;
}

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(){

    vector<string> v(4);
    for (int i = 0; i < 4; ++i)
        cin >> v[i];

    vector<int> sz(4);
    for (int i = 0; i < 4; ++i)
        sz[i] = v[i].size() - 2;

    int b = 0;
    char c='C';

    for (int i = 0; i < 4; ++i){
        int flag1 = 0, flag2 = 0;

        for (int j = 0; j < 4; ++j){

            if (i == j) continue;

            if (sz[i] >= sz[j] * 2) flag1++;
            if (sz[i] * 2 <= sz[j]) flag2++;

        }

        if (flag1 == 3 && flag2 == 3){
            printf("C");
            return 0;
        }
        else if (flag1 == 3 || flag2 ==3){
            b++;
            c = 'A' + i;
        }
    }

    if (b >= 2) printf("C");
    else printf("%c\n", c);

}

#include <cstdio>
#include <cstring>

int l[4];
char str[105];

bool judgeLonger (int x) {
    for (int i = 0; i < 4; i++) {
        if (i == x)
            continue;

        if (l[i] * 2 > l[x])
            return false;
    }
    return true;
}

bool judgeShorter(int x) {
    for (int i = 0; i < 4; i++) {
        if (i == x)
            continue;

        if (l[i] < l[x] * 2)
            return false;
    }
    return true;
}

int main () {
    for (int i = 0; i < 4; i++) {
        scanf("%s", str);
        l[str[0]-'A'] = strlen(str+2);
    }

    int cnt = 0, ans = 0;

    for (int i = 0; i < 4; i++) {
        if (judgeLonger(i) || judgeShorter(i)) {
            cnt++;
            ans = i;
        }
    }

    if (cnt == 1)
        printf("%c\n", ans + 'A');
    else
        printf("C\n");
    return 0;
}

#include <iostream>
#include <string>
#include <cstdio>
#include <iomanip>
#include <map>
#include <cctype>
#include <algorithm>
#include <cstdlib>
using namespace std;

struct data
{
  char symbol;
  int len;
};
int scan()
{
    int a;
    scanf("%d",&a);
    return a;
}
string next()
{
    char ch[101];
    scanf("%s",&ch);
    return ch;
}
int min_len(int pos, data ar[4])
{
    int m = 10000;
    for (int i=0; i<4; i++)
    {
        if(i!=pos)
        {
            m = min(m, ar[i].len);
        }
    }
    return m;
}
int max_len(int pos, data ar[4])
{
    int m = -10000;
    for (int i=0; i<4; i++)
    {
        if(i!=pos)
        {
            m = max(m, ar[i].len);
        }
    }
    return m;
}
const int N = 4;
int main()
{

    ios_base::sync_with_stdio(false);
    data ar[N];
    bool ok = false;
    for (int i=0; i<N; i++)
    {
        string s = next();
        ar[i].symbol = s[0];
        ar[i].len = s.length()-2;
    }
    int pos =2;
    for (int i=0; i<N; i++)
    {
                if(ar[i].len*2<=min_len(i,ar) || ar[i].len>=max_len(i,ar)*2)
                {
                    if(!ok)
                    {
                    ok = true;
                    pos = i;
                    }else
                    {
                        printf("%c",'C');
                        return 0;
                    }
                }

    }
    printf("%c",ar[pos].symbol);
    return 0;
}

#include<iostream>
#include<string>
using namespace std;
int main()
{
    string s[4];
    int l[4];
    char ans1=0,ans2=0;
    for(int i=0;i<4;i++)
	{
        cin>>s[i];
        l[i]=s[i].size()-2;
    }
    for(int i=0;i<4;i++)
	{
        bool f=1;
        for(int j=0;j<4;j++)
		{
            if(i==j) continue;
            if(l[i]<2*l[j])
			{
                f=0;
                break;
            }
        }
        if(f)
		{
            ans1=i+'A';
            break;
        }
    }
    ans2=ans1;
    for(int i=0;i<4;i++)
	{
        bool f=1;
        for(int j=0;j<4;j++)
		{
            if(i==j) continue;
            if(l[i]*2>l[j])
			{
                f=0;
                break;
            }
        }
        if(f)
		{
            ans2=i+'A';
            break;
        }
    }
    if((ans1==ans2&&ans1!=0)) cout<<ans1;
    else if(ans1==0&&ans2!=0) cout<<ans2;
    else cout<<"C";
    return 0;
}

#include <bits/stdc++.h>
#include <vector>
#include <string>
#define forn(i,n) for(int i=0;i<int(n);++i)

using namespace std;
/*written by Animesh R aka aniwrp" */

int main(){

  int c[4];
 string s[4];

  for(int i=0;i<4;i++){
        cin>>s[i];
    c[i] = s[i].size()-2;
   // cout<<c[i]<<"  ";
  }

  sort(c,c+4);

 bool hasmin = c[0]<=c[1]/2;
 bool hasmax = c[3]>=c[2]*2;

// cout<<hasmin <<" hasmax -> "<<hasmax<<endl;

 if(hasmin == hasmax){
    cout<<"C"<<endl;}
 else
  if(hasmin){
    for(int i=0;i<4;i++){
        if(s[i].length() == c[0]+2)
            cout<<s[i][0]<<endl;
    }
  }
  else if(hasmax){
    for(int i=0;i<4;i++){
        if(s[i].length() == c[3]+2)
            cout<<s[i][0]<<endl; }
    }

return 0;
}

#include<bits/stdc++.h>//CF437A The Child and Homework
using namespace std;
#define re register
#define ll long long
#define il inline
#define dou double
#define un unsigned
il int read()
{
	char c=getchar();int x=0,f=1;
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	return x*f;
}
#define N 1000000+10
#define clr memset(x,0,sizeof(x))
char a[N],b[N],c[N],d[N];
int s[5];
int ans=0;
il bool check1(int x)
{
	for(re int i=1;i<=4;i++)
	{
		if(i==x)
			continue;
		if(s[x]<2*s[i])
			return false;
	}
	return true;
}
il bool check2(int x)
{
	for(re int i=1;i<=4;i++)
	{
		if(i==x)
			continue;
		if(s[i]<2*s[x])
			return false;
	}
	return true;
}
int main()
{
	cin.getline(a,N);
	cin.getline(b,N);
	cin.getline(c,N);
	cin.getline(d,N);
	s[1]=strlen(a)-2;
	s[2]=strlen(b)-2;
	s[3]=strlen(c)-2;
	s[4]=strlen(d)-2;
	for(re int i=1;i<=4;i++)
	{
		if(check1(i)||check2(i))
		{
			if(ans==0)
				ans=i;
			else
				ans=5;
		}
	}
	if(ans>0 && ans<5)
		cout<<char(ans+'A'-1)<<endl;
	else
		cout<<'C'<<endl;
	return 0;
}

#include <iostream>
#include <string>
using namespace std;
string A,B,C,D;
int n,ans,curr;
int a,b,c,d;
int mas[5];
int main() {
	cin >> A >> B >> C >> D;
	a = A.size() - 2;
	b = B.size() - 2;
	c = C.size() - 2;
	d = D.size() - 2;

	if ( a * 2 <= min(b,min(c,d)) || a >= max(b,max(c,d)) * 2 )
		mas[0] = 1;
	if ( b * 2 <= min(a,min(c,d)) || b >= max(a,max(c,d)) * 2 )
		mas[1] = 1;
	if ( c * 2 <= min(a,min(b,d)) || c >= max(a,max(b,d)) * 2 )
		mas[2] = 1;
	if ( d * 2 <= min(a,min(b,c)) || d >= max(a,max(b,c)) * 2 )
		mas[3] = 1;
	if ( mas[0] + mas[1] + mas[2] + mas[3] != 1 )
		cout << "C";
	else if ( mas[0] == 1 )
		cout << "A";
	else if (mas[1] == 1)
		cout << "B";
	else if (mas[2] == 1)
		cout << "C";
	else if (mas[3] == 1)
		cout << "D";
	cin >> a;
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>

#define FOR(i,b,e) for(int i=(b); i <= (e); ++i)
#define FORD(i,b,e) for(int i=(b); i >= (e); --i)
#define SIZE(c) (int) (c).size()
#define FOREACH(i,c) FOR(i,0,SIZE(c)-1)
#define FORDEACH(i,c) FORD(i,SIZE(c)-1,0)
#define MIN(x,y) ( ((x) < (y))? (x) : (y) )
#define MAX(x,y) ( ((x) > (y))? (x) : (y) )

#define PB push_back
#define MP make_pair
#define ST first
#define ND second
#define INF 1000000001

using namespace std;

/*************************************************************************/

int main()
{
    ios_base::sync_with_stdio(0);

    string A[4];
    FOR(i,0,3) cin >> A[i];

    bool great[4] = {1,1,1,1};

    FOR(i,0,3)
    {
        bool shorter = 1, longer = 1;

        FOR(j,0,3) if (j != i)
        {
            int si = SIZE(A[i])-2, sj = SIZE(A[j])-2;

            if (2*si > sj) shorter = 0;
            if (si < 2*sj) longer = 0;
        }

        great[i] = (shorter || longer);
    }

    int sum = 0;
    FOR(i,0,3) sum+=great[i];

    if (sum == 1)
    {
        if (great[0]) cout << 'A';
        if (great[1]) cout << 'B';
        if (great[2]) cout << 'C';
        if (great[3]) cout << 'D';
    }
    else
    {
        cout << 'C';
    }

    return 0;
}

/*************************************************************************/

#include <bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    string a,b,c,d;
    string s="";
    vector<pair<int,char> > p;
    int aa=0,bb=0,cc=0,dd=0,mx=0,mn=1e8;
    cin>>a>>b>>c>>d;
    aa=a.length()-2;
    p.push_back({aa,'A'});
    bb=b.length()-2;
    p.push_back({bb,'B'});
    cc=c.length()-2;
    p.push_back({cc,'C'});
    dd=d.length()-2;
    p.push_back({dd,'D'});
    sort(p.rbegin(),p.rend());
    if(p[0].first>=2*p[1].first && p[0].first>=2*p[2].first &&p [0].first>=2*p[3].first)s+=p[0].second;
    if(p[1].first>=2*p[0].first && p[1].first>=2*p[2].first && p[1].first>=2*p[3].first)s+=p[1].second;
    if(p[2].first>=2*p[0].first && p[2].first>=2*p[1].first && p[2].first>=2*p[3].first)s+=p[2].second;
    if(p[3].first>=2*p[0].first && p[3].first>=2*p[1].first && p[3].first>=2*p[2].first)s+=p[3].second;
    if(2*p[0].first<=p[1].first && 2*p[0].first<=p[2].first && 2*p[0].first<=p[3].first)s+=p[0].second;
    if(2*p[1].first<=p[0].first && 2*p[1].first<=p[2].first && 2*p[1].first<=p[3].first)s+=p[1].second;
    if(2*p[2].first<=p[0].first && 2*p[2].first<=p[1].first && 2*p[2].first<=p[3].first)s+=p[2].second;
    if(2*p[3].first<=p[0].first && 2*p[3].first<=p[0].first && 2*p[3].first<=p[2].first)s+=p[3].second;
    if(s.length()==1)cout<<s<<endl;
    else cout<<"C\n";

        return 0;
}

#include "bits/stdc++.h"

using namespace std;

#define int long long
#define cont continue;
#define ff first
#define ss second
#define pb push_back
#define ins insert
#define mp make_pair
#define endl '\n'

typedef vector<int> vi;
typedef set<int> si;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
typedef map<int, int> mi;

//const
#define EPS 1e-9
#define INF LLONG_MAX
const int mod = 1000 * 1000 * 1000 + 7; //1e9+7
const double PI = 3.14159265358979323846264;

// inputs & output & debug
#define w(t) int t; cin>> t; while(t--)

template<typename... T>
void read(T&... args) {
	((cin >> args), ...);
}

template<typename... T>
void write(T&&... args) {
	((cout << args << " "), ...);
}

#define deb(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

//useful functions
//#define deb(x) cout<<#x<<": "<<x<<endl;
#define isPowOfTwo(x) return (x && (!(x&(x-1))));
#define sz(a) (int)((a).size())
#define present(c,x) ((c).find(x) != (c).end())
#define ip_arr(a,n)   for(int i=0;i<n;i++) cin>>a[i];
#define op_arr(arr,n) for(int i=0;i<n;i++) cout<<arr[i]<<"\n"; cout<<endl;
#define fill_arr(arr,n,i) fill(arr,arr+n,i)
#define fill_vec(v,n,i) fill(v.begin(),v.begin()+n,i);
#define sortv(a) sort(a.begin(),a.end())

void fio()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}
void setUpLocal()
{
#ifndef ONLINE_JUDGE
	freopen("/Users/asuryana/Documents/CP/input.txt", "r", stdin);
	freopen("/Users/asuryana/Documents/CP/output.txt", "w", stdout);
#else
#define cerr if(0) cerr
#endif
}

const int gp_size = (int)1e6 + 7;
// vi gp[gp_size];
// int vis[gp_size];
// int cnt[gp_size];

void solve()
{

	string a, b, c, d;
	int p, q, r, s;
	read(a, b, c, d);
	p = a.length() - 2;
	q = b.length() - 2;
	r = c.length() - 2;
	s = d.length() - 2;

	char ans = 'C';
	int cnt = 0;
	if ((2 * q <= p and r * 2 <= p and s * 2 <= p) or (q >= 2 * p and r >= 2 * p and s >= 2 * p))
	{
		ans = 'A'; cnt++;
	}
	if ((p * 2 <= q and r * 2 <= q and s * 2 <= q) or (p >= 2 * q and r >= 2 * q and s >= 2 * q))
	{
		ans = 'B'; cnt++;
	}
	if ((p * 2 <= r and q * 2 <= r and s * 2 <= r) or (p >= 2 * r and q >= 2 * r and s >= 2 * r))
	{
		ans = 'C'; cnt++;
	}
	if ((q * 2 <= s and r * 2 <= s and p * 2 <= s) or (q >= 2 * s and r >= 2 * s and p >= 2 * s))
	{
		ans = 'D'; cnt++;
	}

	deb(p, q, r, s, ans, cnt);

	if (cnt == 1)
		cout << ans;
	else
		cout << "C";

}

int32_t main()
{
	fio();
	setUpLocal();
	return solve(), 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

//macros
#define fi first
#define se second
#define pb push_back
#define ReadInputFile() freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
#define FAST_IO() ios_base::sync_with_stdio(false);cin.tie(nullptr);
const ll MAX = 1e5+5;
const long long int Pinf = INT_MAX, Ninf = INT_MIN;
const long int mod = 1e9+7;

//debug template
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second);
cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""),
                          __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

int main() {
    //ReadInputFile();
    FAST_IO();
    string description;
    map<int,char>mp;
    vector<int>arr;
    char c = 'A';
    multiset<int, greater<int>>ms;
    for (int i = 0; i < 4; i++) {
        getline(cin, description);
        string x = description.substr(2,description.size());
        arr.pb(x.size());
        mp[x.size()] = c++;
        ms.insert(x.size());
    }
    sort(arr.begin(),arr.end());
    debug(ms,arr);
    set<int>s,p;
    for(int i = 1; i < 4; i++){
        if(arr[0] <= arr[i]/2){
            // cout << i << " True" << "\n" ;
            s.insert(arr[0]);
        }
        else{
            // cout << i << " False" << "\n" ;
            s.insert(0);
        }
    }
    for(int i = 0; i < 3; i++){
        if(arr[3] >= arr[i]*2){
            // cout << i << " True" << "\n" ;
            p.insert(arr[3]);
        }else{
            // cout << i << " False" << "\n" ;
            p.insert(0);
        }
    }
    debug(s,p);
    if(s.size() == 1 and p.size() == 1){
        cout << 'C' << "\n";
    }
    else if(s.size() == 1 and *(s.begin()) != 0){
        cout << mp[*(s.begin())] << "\n";
    }else if(p.size() == 1 and *(p.begin()) != 0 ){
        cout << mp[*(p.begin())] << "\n" ;
    }else{
        cout << 'C' << "\n";
    }
}

#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

string o[4];

int main() {

    int maxlength = 0, minlength = 110, maxindex = 0, minindex = 0;

    int c[4];

    for (int i = 0; i < 4; i++) {
        getline(cin, o[i]);
        c[i] = o[i].length() - 2;
    }

    sort(c, c + 4);

    bool hasMax = c[3] >= c[2] * 2;
    bool hasMin = c[0] <= c[1] / 2;

    if (hasMax == hasMin) {
        cout << "C";
    } else if (hasMin) {
        for (int i = 0; i < 4; i++) {
            if (c[0] + 2 == o[i].length()) {
                cout << o[i].at(0);
            }
        }
    } else if (hasMax) {
        for (int i = 0; i < 4; i++) {
            if (c[3] + 2 == o[i].length()) {
                cout << o[i].at(0);
            }
        }
    }

    return 0;
}

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include<bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define fastio              ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define int                 long long
#define ll                  long long
#define ld                  long double
#define vi                  vector<int>
#define pii                 pair<int,int>
#define vpii                vector< pair<int,int> >
#define uset                unordered_set
#define umap                unordered_map
#define maxpq               priority_queue<int>
#define minpq               priority_queue<int,vi,greater<int>()>

#define all(v)              v.begin(),v.end()
#define part(v,s,e)         v.begin()+s,v.begin()+e
#define rev(v)              reverse(v.begin(),v.end())
#define sz(x)               (int)x.size()
#define def(v)              memset(v,-1,sizeof(v));
#define def0(v)             memset(v,0,sizeof(v));
#define minv(a)             *min_element(all(a))
#define maxv(a)             *max_element(all(a))
#define sumv(a)             accumulate(all(a),0)

#define lb                  lower_bound         // returns pointer to the "first position of num" if number is present in the container. Returns pointer to the "position of next higher number greater than num" if num is not present.
#define ub                  upper_bound         // returns pointer to the "first position of the next higher number than last occurence of num" if num is present in the container. Returns pointer to the position of next higher number than num if container does not contain occurence of num.
#define desc                greater<int>()
#define pb                  emplace_back
#define mp                  make_pair
#define F                   first
#define S                   second

#define mod                 1000000007
#define inf                 1000000000000000
#define infty               1000000000000000000LL
#define md                  998244353
#define PI                  acos(-1.0)
#define endl                "\n"
#define rr                  return
#define br                  cout<<"\n";
#define hr                  for(int i=0;i<40;i++)    cout<<"-";cout<<endl;

#define gcd(a,b)            __gcd(a,b)
#define lcm(a,b)            (a/(__gcd(a,b)))*b

#define setbits(x)          __builtin_popcountll(x)
#define leadzero(x)         __builtin_clzll(x)
#define trailzero(x)        __builtin_ctzll(x)

#define ip(v)               for(auto& i:v)    cin>>i;
#define op(v)               for(auto i:v)    cout<<i<<" ";cout<<endl;
#define deb(x)              cout <<"Value of " #x << " : " << x << endl;

#define ordered_set         tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>

#ifndef ONLINE_JUDGE
#define dbg(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {cout << name << " : " << arg1 << endl;}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cout.write(names, comma - names) << " : " << arg1 << "  ";
    __f(comma + 1, args...);
}
#else
#define dbg(...) 50
#endif

//------------------------------Main Code Starts--------------------------------//

void solve()
{

    string s[4];
    ip(s);

    vi v;
    for(auto i:s)
    {
        v.pb(i.size());
    }
    sort(all(v));

    if(v[0]*2-4<=v[1]-2 and v[2]*2-4<=v[3]-2)
    {
        cout<<"C\n";
        rr;
    }

    if(v[0]*2-4<=v[1]-2)
    {
        char ans;
        for(int i=0;i<4;i++)
        {
            if(s[i].size()==v[0])
            {
                ans=i+65;
                break;
            }
        }
        cout<<ans<<endl;
        rr;
    }

    if(v[2]*2-4<=v[3]-2)
    {
        char ans;
        for(int i=0;i<4;i++)
        {
            if(s[i].size()==v[3])
            {
                ans=i+65;
                break;
            }
        }
        cout<<ans<<endl;
        rr;
    }

    cout<<"C\n";

}

int32_t main()
{

    fastio
    cout<<setprecision(15)<<fixed;

    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
        freopen("error.txt","w",stderr);
    #endif

    int t=1;
    // cin>>t;

    for(int i=1;i<=t;i++)
    {
        // cout<<"Case #"<<i<<": \n";
        solve();
    }

    #ifndef ONLINE_JUDGE
        cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
    #endif

    return 0;
}

// AUTHOR: AMAN JAIN
#include <bits/stdc++.h>
using namespace std;

#define s(n)                        scanf("%d",&n)
#define sc(n)                       scanf("%c",&n)
#define sl(n)                       scanf("%lld",&n)
#define sf(n)                       scanf("%lf",&n)

#define p(n)                        printf("%d",&n)
#define pc(n)                       printf("%c",&n)
#define pl(n)                       printf("%lld",&n)
#define pf(n)                       printf("%lf",&n)
#define ps(n)                       printf("%s",n)

#define VI vector < int >
#define VVI(A,N,M) vector< VI > A( N, VI (M) )
#define LL long long
#define LLU unsigned long long
#define PI acos(-1)
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int) (x).size())
#define CLR(v) memset(v,0,sizeof(v))
#define SORT(c) sort(ALL(c))
#define FIT(it,v) for (typeof(v.begin()) it = v.begin(); it != v.end(); it++)
#define FITD(it,v) for (typeof(v.rbegin()) it = v.rbegin(); it != v.rend(); it++)
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define IATOV(a) ({vector<int> v(a,a+sizeof(a)/sizeof(int));v;})
#define CATOV(a) ({vector<char> v(a,a+sizeof(a)/sizeof(char));v;})
#define sieve(a) ({int b=ceil(sqrt(a));VI d(a,0);VI e;int f=2;e.pb(2);e.pb(3);for(int x=1;x<b+1;x++){for(int y=1;y<b+1;y++){int n=(4*x*x)+(y*y);if(n<=a&&(n%12==1||n%12==5)){d[n]^=1;}n=(3*x*x)+(y*y);if(n<=a&&n%12==7){d[n]^=1;}n=(3*x*x)-(y*y);if(x>y&&n<=a&&n%12==11){d[n]^=1;}}}for(int r=5;r<b+1;r++){if(d[r]){for(int i=r*r;i<a;i+=(r*r)){d[i]=0;}}}for(int c=5;c<a;c++){if(d[c]){e.pb(c);}}e;})
#define INF 1000000007
#define EPS 1e-9
#define mt(x, y, z) mp(mp(x,y),z)
#define in_s(c,x) ((c).find(x) != (c).end())
#define in_o(c,x) (find(all(c),x) != (c).end())
#define setbits(x) __builtin_popcount(x) //tell number of 1's in binary form
#define GC getchar_unlocked
#define out_c(start,end) copy(start, end, ostream_iterator< typeof(*start) >(cout, " "));
template<class T>inline T modinv(T a,T n){T i=n,v=0,d=1;while(a>0){T t=i/a,x=a;a=i%x;i=x;x=d;d=v-t*x;v=x;}return (v+n)%n;}
LL modpow(LL n ,LL k,LL mod){LL ans=1;while(k>0){if(k&1)ans=(ans*n)%mod;k>>=1;n=(n*n)%mod;}return ans%mod;}
//template<class T>inline void output(T a){if(a){T v=a%10;output(a/10);putchar((char)(v+'0'));}}
//template<class T>inline T input(T x){char c=GC();x=0;T s=1;while(c<48||c>57){if(c=='-')s=-1;c=GC();}while(c>=48&&c<=57){x=(x<<3)+(x<<1)+c-48;c=GC();}return x*s;}

template <class T> string str(T Number){
	string Result;          // string which will contain the result
	ostringstream convert;   // stream used for the conversion
	convert << Number;      // insert the textual representation of 'Number' in the characters in the stream
	Result = convert.str();
	return Result;
}
int StringToNumber ( const string &Text )
{
     istringstream ss(Text);
     int result;
     return ss >> result ? result : 0;
}
template<class T> inline vector<pair<T,int> > FACTORISE(T n){vector<pair<T,int> >R;for (T i=2;n>1;){if (n%i==0){int C=0;for (;n%i==0;C++,n/=i);R.push_back(make_pair(i,C));}i++;if (i>n/i) i=n;}if (n>1) R.push_back(make_pair(n,1));return R;}
template<class T> inline T TOTIENT(T n) {vector<pair<T,int> > R=FACTORISE(n);T r=n;for (int i=0;i<R.size();i++)r=r/R[i].first*(R[i].first-1);return r;}
template<class T>inline T gcd(T a,T b){return b?gcd(b,a%b):a;}
double rnd(float d) //for rounding values
{
	          return floor(d + 0.49);
}
int main(int argc, char const *argv[])
{
	string a,b,c,d;
	cin>>a>>b>>c>>d;
	int na=sz(a)-2;
	int nb=sz(b)-2;
	int nc=sz(c)-2;
	int nd=sz(d)-2;
	set<char> ans;
	std::vector<int> v;
	v.pb(na);
	v.pb(nb);
	v.pb(nc);
	v.pb(nd);
	for(int i=0;i<4;++i){
		int co=0;
		for(int j=0;j<4;++j){
			if(i==j){
				continue;
			}
			if(v[j]*2<=v[i]){
				++co;
			}
		}
		if(co==3){
			ans.insert(i+65);
		}
	}
	for(int i=0;i<4;++i){
		int co=0;
		for(int j=0;j<4;++j){
			if(i==j){
				continue;
			}
			if(v[j]>=2*v[i]){
				++co;
			}
		}
		if(co==3){
			ans.insert(i+65);
		}
	}
	if(sz(ans)==1){
		cout<<*(ans.begin());
		return 0;
	}
	cout<<'C';
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

string A,B,C,D;
int a,b,c,d;

int main(){
#ifndef ONLINE_JUDGE
    freopen("in.in","r",stdin);
    freopen("out.out","w",stdout);
    double startTime = clock();
#endif

    cin>>A>>B>>C>>D;
    a = A.length() - 2;
    b = B.length() - 2;
    c = C.length() - 2;
    d = D.length() - 2;
    bool is_a = 0 , is_b = 0 , is_c = 0 , is_d = 0;

    if( (a * 2 <= b && a * 2 <= c && a * 2 <= d) || (a >= 2 * b && a >= 2 * c && a >= 2 * d) )
        is_a = 1;
    if( (b * 2 <= a && b * 2 <= c && b * 2 <= d) || (b >= 2 * a && b >= 2 * c && b >= 2 * d) )
        is_b = 1;
    if( (c * 2 <= a && c * 2 <= b && c * 2 <= d) || (c >= 2 * a && c >= 2 * b && c >= 2 * d) )
        is_c = 1;
    if( (d * 2 <= a && d * 2 <= b && d * 2 <= c) || (d >= 2 * a && d >= 2 * b && d>= 2 * c) )
        is_d = 1;

    string ans;

    if(is_a == 1 && is_b == 0 && is_c == 0 && is_d == 0)
        ans = "A";
    else if(is_b == 1 && is_a == 0 && is_c == 0 && is_d == 0)
        ans = "B";
    else if(is_d == 1 && is_a == 0 && is_b == 0 && is_c == 0)
        ans = "D";
    else
        ans = "C";

    cout<<ans<<'\n';

#ifndef ONLINE_JUDGE
    cout<<"RunTime is : "<<(clock()-startTime)/CLOCKS_PER_SEC<<'\n';
#endif
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
string a,b,c,d;
int l,s;
struct node{
	string a;
	int len;
	char h;
}Node[5];
bool cmp(node a,node b){
	return a.len>b.len;
}
int main(){
	cin>>Node[1].a>>Node[2].a>>Node[3].a>>Node[4].a;
	for(int i=1;i<=4;i++){
		Node[i].len=Node[i].a.length()-2;
		Node[i].h=i-1+'A';
	}
	sort(Node+1,Node+5,cmp);
	/*for(int i=1;i<=4;i++){
		cout<<Node[i].len<<" ";
	}*/
	if(Node[1].len>=2*Node[2].len&&Node[3].len>=2*Node[4].len){
		cout<<"C"<<endl;
		return 0;
	}
	if(Node[1].len>=2*Node[2].len){
		cout<<Node[1].h<<endl;
		return 0;
	}
	if(Node[3].len>=2*Node[4].len){
		cout<<Node[4].h<<endl;
		return 0;
	}
	cout<<"C"<<endl;
	return 0;
}

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll          long long
#define pb          push_back
#define eb 			emplace_back
#define mp 			make_pair
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define fi          first
#define si          second
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define checkbit(n, b) ((n >> b) & 1)
#define mod        1000000007
#define inf        1000000000000000000
#define iinf        -1000000000000000000
#define puts(n)		cout<<n;
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define setbits(x) __builtin_popcount(x)
#define mset(m,v) memset(m,v,sizeof(m))
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

string a,b,c,d;
cin>>a>>b>>c>>d;
ll flag1=0,flag2=0,flag3=0, flag4=0,county1=0,county2=0,county3=0,county4=0;
ll a1=a.size()-2,b1=b.size()-2,c1=c.size()-2,d1=d.size()-2;//cout<<a1<<" "<<b1<<" "<<c1<<" "<<d1<<" ";
rep(i,2,a1+2)
if(a[i]=='_')
    county1++;
rep(i,2,b1+2)
if(b[i]=='_')
    county2++;
rep(i,2,c1+2)
if(c[i]=='_')
    county3++;
rep(i,2,d1+2)
if(d[i]=='_')
    county4++;
if(a1==county1)
flag1=1;
if(b1==county2)
    flag2=1;
if(d1==county4)
    flag4=1;
    ll flaga=0,flagb=0,flagd=0,flagc=0;
//cout<<flag1<<" "<<flag2<<" "<<flag3<<" "<<flag4<<" "<<county1<<" "<<county2<<" "<<county3<<" "<<county4<<" ";
if(flag1==0 && ((a1>=2*b1 && a1 >=2*c1 && a1>=2*d1) || (2*a1<=b1 && 2*a1<=c1 && 2*a1<=d1)))
flaga=1;
 if(flag2==0 && ((b1>=2*a1 && b1 >=2*c1 && b1>=2*d1) || (2*b1<=a1 && 2*b1<=c1 && 2*b1<=d1)))
flagb=1;

 if(flag3==0 && ((c1>=2*b1 && c1 >=2*d1 && c1>=2*a1) || (2*c1<=b1 && 2*c1<=d1 && 2*c1<=a1)))
    flagc=1;
 if(flag4==0 && ((d1>=2*b1 && d1 >=2*c1 && d1>=2*a1) || (2*d1<=b1 && 2*d1<=c1 && 2*d1<=a1)))
    flagd=1;
    //else cout<<"C";
if(flaga==1 && flagb!=1 && flagc!=1 && flagd!=1)
cout<<"A";
else if(flaga!=1 && flagb==1 && flagc!=1 &&flagd!=1)
    cout<<"B";
    else if(flaga!=1 &&flagc!=1&&  flagb!=1 && flagd==1)
        cout<<"D";
    else cout<<"C";
        return  0;}

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<algorithm>
#include<vector>
#include<queue>
#include<list>
#include<string>
#include<set>
#include<map>
#include<iomanip>
#include<sstream>
#include<functional>
#include<climits>
#define eps 1e-9
const int mod = 1e9 + 7;
using namespace std;

int main() {

    string a, b, c, d;
    getline(cin, a);
    getline(cin, b);
    getline(cin, c);
    getline(cin, d);
    string a1 = a.substr(2, a.size() - 2);
    string b1 = b.substr(2, b.size() - 2);
    string c1 = c.substr(2, c.size() - 2);
    string d1 = d.substr(2, d.size() - 2);
    char anssh = 'C', ansl = 'C';
    int sh = 0, l = 0;
    if (a1.size() <= b1.size() / 2 && a1.size() <= c1.size() / 2 && a1.size() <= d1.size() / 2) {
        sh++;
        anssh = 'A';
    }
    if (b1.size() <= a1.size() / 2 && b1.size() <= c1.size() / 2 && b1.size() <= d1.size() / 2) {
        sh++;
        anssh = 'B';
    }
    if (c1.size() <= a1.size() / 2 && c1.size() <= b1.size() / 2 && c1.size() <= d1.size() / 2) {
        sh++;
        anssh = 'C';
    }
    if (d1.size() <= a1.size() / 2 && d1.size() <= b1.size() / 2 && d1.size() <= c1.size() / 2) {
        sh++;
        anssh = 'D';
    }
    if (a1.size() >= b1.size() * 2 && a1.size() >= c1.size() * 2 && a1.size() >= d1.size() * 2) {
        l++;
        ansl = 'A';
    }
    if (b1.size() >= a1.size() * 2 && b1.size() >= c1.size() * 2 && b1.size() >= d1.size() * 2) {
        l++;
        ansl = 'B';
    }
    if (c1.size() >= a1.size() * 2 && c1.size() >= b1.size() * 2 && c1.size() >= d1.size() * 2) {
        l++;
        ansl = 'C';
    }
    if (d1.size() >= a1.size() * 2 && d1.size() >= b1.size() * 2 && d1.size() >= c1.size() * 2) {
        l++;
        ansl = 'D';
    }
    if (l == 1 && sh == 0) {
        cout << ansl << endl;
        return 0;
    }
    if (sh == 1 && l == 0) {
        cout << anssh << endl;
        return 0;
    }
    cout << 'C' << endl;
    return 0;
}

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <cstdlib>
#include <set>
#include <map>
#include <fstream>

#define PI 3.14159265359

using namespace std;
typedef unsigned long long ull;

template <typename T>
void print2dvector(vector< vector<T> > v)
{
    cout << "A 2d vector:" << endl;
    int a = v.size();
    int b = v[0].size();

    if (a <= 15 && b <= 15)
    {
        for (int i=0; i<a; i++)
        {
            for (int j=0; j<b; j++)
            {
                cout << setw(4) << v[i][j];
            }
            cout << endl;
        }

    }

    if (a > 15 && b > 15)
    {
        for (int i=0; i<9; i++)
        {
            for (int j = 0; j<9; j++)
            {
                cout << setw(4) << v[i][j];
            }
            cout << "   " << ".   .   ." << setw(4) << v[i][b-3] << setw(4) << v[i][b-2] << setw(4) << v[i][b-1] << endl;
        }

        for (int i=0; i<15; i++)
        {
            cout << setw(4) << '.';
        }
        cout << endl;

        for (int i=a-3; i<a; i++)
        {
            for (int j = 0; j<9; j++)
            {
                cout << setw(4) << v[i][j];
            }
            cout << "   " << ".   .   ." << setw(4) << v[i][b-3] << setw(4) << v[i][b-2] << setw(4) << v[i][b-1] << endl;
        }
    }

    if (a>15)
    {
        for (int i=0; i<9; i++)
        {
            for (int j=0; j<b; j++)
            {
                cout << setw(4) << v[i][j];
            }
            cout << endl;
        }

        for (int i=0; i<b; i++)
        {
            cout << setw(4) << '.';
        }
        cout << endl;

        for (int i=a-3; i<a; i++)
        {
            for (int j = 0; j<b; j++)
            {
                cout << setw(4) << v[i][j];
            }
            cout << endl;
        }

    }

    if (b>15)
    {
        for (int i=0; i<a; i++)
        {
            for (int j = 0; j<9; j++)
            {
                cout << setw(4) << v[i][j];
            }
            cout << "   " << ".   .   ." << setw(4) << v[i][b-3] << setw(4) << v[i][b-2] << setw(4) << v[i][b-1] << endl;
        }
    }

}

template <typename T>
void printvector(vector<T> v)
{
    cout << "A 1d vector:" << endl;
    int a = v.size();

    if (a <= 15)
    {
        for (int i=0; i<a; i++)
        {
            cout << setw(4) << v[i];
        }
    }

    else
    {
        for (int i=0; i<9; i++)
        {
            cout << setw(4) << v[i];
        }
        cout << "   " << ".   .   ." << setw(4) << v[a-3] << setw(4) << v[a-2] << setw(4) << v[a-1];
    }

    cout << endl;
}

int main()
{
    string A, B, C, D;
    int c = 0;
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> D;
    int a_size = A.size()-2;
    int b_size = B.size()-2;
    int c_size = C.size()-2;
    int d_size = D.size()-2;

    //cout << a_size << " " << b_size << " " << c_size << " " << d_size << endl;

    if((2*a_size<=b_size && 2*a_size<=c_size && 2*a_size<=d_size) || (a_size >= 2*b_size && a_size >= 2*c_size && a_size >= 2*d_size))
    {
        //cout << "Here1" << endl;
        c++;
        //cout << "A" << endl;
        //return 0;
    }

    if((2*b_size<=a_size && 2*b_size<=c_size && 2*b_size<=d_size) || (b_size >= 2*a_size && b_size >= 2*c_size && b_size >= 2*d_size))
    {
        c++;
        //cout << "B" << endl;
        //return 0;
    }

    if((2*c_size<=a_size && 2*c_size<=b_size && 2*c_size<=d_size) || (c_size >= 2*a_size && c_size >= 2*b_size && c_size >= 2*d_size))
    {
        c++;
        //cout << "D" << endl;
        //return 0;
    }

    if((2*d_size<=a_size && 2*d_size<=c_size && 2*d_size<=b_size) || (d_size >= 2*a_size && d_size >= 2*c_size && d_size >= 2*b_size))
    {
        c++;
        //cout << "D" << endl;
        //return 0;
    }

    if(c == 1)
    {
        if((2*a_size<=b_size && 2*a_size<=c_size && 2*a_size<=d_size) || (a_size >= 2*b_size && a_size >= 2*c_size && a_size >= 2*d_size))
    {
        c++;
        cout << "A" << endl;
        return 0;
    }

    if((2*b_size<=a_size && 2*b_size<=c_size && 2*b_size<=d_size) || (b_size >= 2*a_size && b_size >= 2*c_size && b_size >= 2*d_size))
    {
        c++;
        cout << "B" << endl;
        return 0;
    }
    if((2*d_size<=a_size && 2*d_size<=c_size && 2*d_size<=b_size) || (d_size >= 2*a_size && d_size >= 2*c_size && d_size >= 2*b_size))
    {
        c++;
        cout << "D" << endl;
        return 0;
    }

        cout << "C" << endl;
        return 0;
    }
    else
    {
        cout << "C" << endl;
        return 0;
    }
    //cout << "C" << endl;
    return 0;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<map>
#include<set>
using namespace std;
#define INF 1000000000
//typedef __int64 LL;
char str[5][200];
int len[5];
int main()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
#endif // ONLINE_JUDGE
	for(int i=1; i<=4; i++)
    {
        scanf("%s",str[i]);
        len[i]=strlen(str[i])-2;
    }
    int flag=0;
    int out=-1;
    for(int i=1; i<=4; i++)
    {
        int cou1=0, cou2=0;
        for(int j=1;j<=4; j++)
        {
            if(i==j) continue;
            if(len[i]>=2*len[j]) cou1++;
            if(len[i]*2<=len[j]) cou2++;
        }
        if(cou1>=3 || cou2>=3)
        {
            flag++; out=i;
        }
    }
    if(flag==1)
    {
        printf("%c\n", out-1+'A');
    }
    else
    {
        printf("C\n");
    }

	return 0;
}

#include<iostream>
#include<string>

using namespace std;

int main()
{
    string A,B,C,D;
    int sa,sb,sc,sd;
    cin>>A;
    cin>>B;
    cin>>C;
    cin>>D;
    sa=sb=sc=sd=0;
    for(int a=2;a<A.size();a++)
        sa++;
    for(int a=2;a<B.size();a++)
        sb++;
    for(int a=2;a<C.size();a++)
        sc++;
    for(int a=2;a<D.size();a++)
        sd++;
    int count=0;
    bool vv[4]={false,false,false,false};
    if((sa>=2*sb&&sa>=2*sc&&sa>=2*sd)||(2*sa<=sb&&2*sa<=sc&&2*sa<=sd))
    {
        vv[0]=true;
        count++;
    }
    if((sb>=2*sa&&sb>=2*sc&&sb>=2*sd)||(2*sb<=sa&&2*sb<=sc&&2*sb<=sd))
    {
        vv[1]=true;
        count++;
    }
    if((sc>=2*sb&&sc>=2*sa&&sc>=2*sd)||(2*sc<=sb&&2*sc<=sa&&2*sc<=sd))
    {
        vv[2]=true;
        count++;
    }
    if((sd>=2*sb&&sd>=2*sc&&sd>=2*sa)||(2*sd<=sb&&2*sd<=sc&&2*sd<=sa))
    {
        vv[3]=true;
        count++;
    }
    if(count>1)
        cout<<"C";
    else
    {
        if(vv[0]==true)
            cout<<"A";
        else if(vv[1]==true)
            cout<<"B";
        else if(vv[2]==true)
            cout<<"C";
        else if(vv[3]==true)
            cout<<"D";
        else
            cout<<"C";
    }

    return 0;
}

//In the name of God
//-----gmmj

#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>

#define Rep(I,N) for(int I=0;I<N;++I)
#define For(J,R,K) for(int J=R;J<K;++J)
#define DRI(X) int x;scanf("%d",&X);
#define DRII(X1,Y1) int X1,Y1;scanf("%d%d",&X1,&Y1);
#define RI(X2) scanf("%d",&X2);
#define WI(X4) printf("%d",X4);
#define WII(X5,X6) printf("%d %d",X5,X6);
#define SF scanf
#define PF printf
#define Pii pair<int,int>
#define Ff first
#define Ss Seconde

typedef long long ll;

using namespace std;

string st[4];

ll a[4],b[4];

void comp(int i){
		Rep(j,4)
			if(a[i]==b[j]){
				cout<<st[j][0];
				return ;
			}

}

int main(){
	//freopen("a.in","r",stdin);
	Rep(i,4){
		cin>>st[i];
		a[i]=b[i]=st[i].size()-2;
	}
	Rep(i,4)
		Rep(j,3)
		 if(a[j]<a[j+1])
			 swap(a[j],a[j+1]);
	if(a[0]>=2*a[1])
		comp(0);
	else if(a[3]*2<=a[2])
		comp(3);
	else
		cout<<"C";
	return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;
struct abc {
    string a,b;
};
abc w[10];
bool comp(abc a,abc b)
{
    return a.a.length()<b.a.length();
}
int main()
{
    string s;
    int n = 4;
    for(int i = 1; i <= n; i++)
    {
        cin>>s;
        w[i].b+=s.substr(0,1);
        w[i].a+=s.substr(2);
    }
    sort(w+1,w+n+1,comp);
    bool ok = true;
    for(int i = 2; i <= 4;i++)
    {
        if(w[i].a.length() <= w[1].a.length() * 2)
        {
            ok = false;
        }
    }
    if(ok)
    {
        cout<<w[1].b;
        return 0;
    }
    ok = true;
    for(int i = 1; i < 4;i ++)
    {
        if(w[i].a.length() * 2 > w[4].a.length())
            ok = false;
    }
    if(ok)
    {
        cout<<w[4].b;
        return 0;
    }
    cout<<"C";
    return 0;
}

//============================================================================
// Name        : CF.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include<iostream>
#include<string>
#include<cmath>
#include<cstring>
#include <vector>
#include <algorithm>
#include <map>
#include <deque>
#include<queue>
#include <sstream>
#include<stdio.h>
using namespace std;

bool check(int a,int b,int c,int d){
    if(a<= b/2.0 && a<=c/2.0 && a<=d/2.0)
        return true;
    if(a>=2*b && a>=2*c && a>=2*d)
            return true;
    return false;
}
int main() {
    map<char,int> m;
    string s;
    for(char c='A'; c!='E'; c++)
    {
        getline(cin,s);
        int x = s.size()-2;
        m[c]=x;
    }

    pair<char,int> p;
    p.first='_';
    p.second=0;

    if(check(m['A'],m['B'],m['C'],m['D']))
        p=make_pair('A',p.second+1);
    if(check(m['B'],m['C'],m['D'],m['A']))
        p=make_pair('B',p.second+1);
    if(check(m['D'],m['B'],m['C'],m['A']))
        p=make_pair('D',p.second+1);

    if(p.second==0 || p.second>1)
        cout<<'C'<<endl;
    else
        cout<<p.first<<endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
    string a,b,c,d;
    cin>>a;
    cin>>b;
    cin>>c;
    cin>>d;
    int lena=a.length()-2;
    int lenb = b.length()-2;
    int lenc = c.length()-2;
    int lend = d.length() -2;
    int minval = min(lena,min(lenb,min(lenc,lend)));
    int maxval = max(lena,max(lenb,max(lenc,lend)));
    int count=0;
    string ans;
    if((minval==lena&&minval*2<=lenb&&minval*2<=lenc&&minval*2<=lend)||(maxval==lena&&lenb<=maxval/2&&lenc<=maxval/2&&lend<=maxval/2))
    {
        count++;
        ans="A";
    }
    else if((minval==lenb&&minval*2<=lena&&minval*2<=lenc&&minval*2<=lend)||(maxval==lenb&&lena<=maxval/2&&lenc<=maxval/2&&lend<=maxval/2))
    {
        count++;
        ans="B";
    }
    else if((minval==lenc&&minval*2<=lena&&minval*2<=lenb&&minval*2<=lend)||(maxval==lenc&&lena<=maxval/2&&lenb<=maxval/2&&lend<=maxval/2))
    {
        count++;
        ans="C";
    }
    else if((minval==lend&&minval*2<=lena&&minval*2<=lenb&&minval*2<=lenc)||(maxval==lend&&lena<=maxval/2&&lenb<=maxval/2&&lenc<=maxval/2))
    {
        count++;
        ans="D";
    }

   if(count>1)
   {
       cout<<"C"<<endl;
   }
   else{
       cout<<ans<<endl;
   }
return 0;
}

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	string s;
	int b[4],c[4], zam = 0,x;
	for (int i = 0; i < 4; i++)
	{
		cin >> s;
		b[i] = s.length() - 2;
	}

	for (int i = 0; i < 4; i++)
	{
		c[i] = b[i];
		//cout << c[i] << " ";
	}

	sort(b,b+4);

	cout << endl;

	/*for (int i = 0; i < 4; i++)
	{
		cout << b[i] << " ";
	}*/
	if (b[0]*2 <= b[1])
	{
		zam++;
		x = b[0];
	}

	if (b[3] >= b[2] * 2)
	{
		zam++;
		x = b[3];
	}
	//cout << x << "  " << zam << endl;

	if (zam == 1)
	{
		for (int i = 0; i < 4;i++)
		{
			if (x == c[i])
			{
				cout <<  char('A' + i);
				break;
			}
		}
	}

	else cout << "C";

	return 0;
}

#include<bits/stdc++.h>
#include<set>
#include<iostream>
#include<string>
#include<cmath>
#include<iomanip>
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define pb push_back
#define ll long long
#define PI 3.14159265
#define ls l,m,rt<<1
#define rs m+1,r,rt<<1|1
#define eps 1e-7
typedef unsigned long long ull;
const int mod=1e9+7;
const int maxn=1e4+5;
const int inf=0x4f4f4f4f;
using namespace std;
string b[5];
struct node
{
    int a,i;
    bool operator<(const node b)const
    {
        return a<b.a;
    }
}st[5];
int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    for(int i=0;i<4;i++)
    {
        cin>>b[i];
        st[i].a=b[i].size()-2;
        st[i].i=i;
    }
    sort(st,st+4);
    if(st[0].a<=st[1].a/2)
    {
        char ans='A'+st[0].i;
        cout<<ans<<endl;
    }
    else if(st[3].a>=2*st[2].a)
    {
        char ans='A'+st[3].i;
        cout<<ans<<endl;
    }
    else
    {
        cout<<"C"<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    string a,b,c,d;
        getline(cin,a);
        getline(cin,b);
        getline(cin,c);
        getline(cin,d);

    int x=a.length()-2,y=b.length()-2,z=c.length()-2,w=d.length()-2,mi,ma;
    mi=min(min(x,y),w);
    ma=max(max(x,y),w);
    if((mi==w)&&(mi==y)&&(mi==z)&&(ma>=(w*2))){
        cout<<a.substr(0,1)<<endl;
        return 0;

    }else if((mi==w)&&(mi==x)&&(mi==z)&&(ma>=(w*2))){
        cout<<b.substr(0,1)<<endl;
        return 0;

    }else if((mi==x)&&(mi==y)&&(mi==z)&&(ma>=(x*2))){
        cout<<d.substr(0,1)<<endl;
        return 0;

    }

    else if(mi==x && ma>=(mi*2) ){
        cout<<a.substr(0,1)<<endl;
        return 0;

    }else if(mi==y && ma>=(mi*2)){
        cout<<b.substr(0,1)<<endl;
        return 0;

    }else if(mi==w && ma>=(mi*2)){
        cout<<d.substr(0,1)<<endl;
        return 0;

    }else{
        cout<<y<<" "<<x;
        cout<<c.substr(0,1)<<endl;
        return 0;

    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	string s[4];
	int a[4],b[4],maxcount=0,mincount=0,gc1=0,gc2=0;
	for(int i=0;i<4;i++){
		cin >> s[i];
		a[i]=s[i].length()-2;
		b[i]=a[i];
	}
	sort(b,b+4);
	int max =b[3];
	int min = b[0];
	for(int i=0;i<4;i++){
		if(max>=(2*a[i])) gc1++;
		if(min<=(2*a[i])) gc2++;

		if(a[i]==max) maxcount++;
		if(a[i]==min) mincount++;
	}
	// cout << gc1 << " " << gc2 << "\n";
	// maxcount--;
	// mincount--;
	if(maxcount+gc1==4) gc1=1;
	else gc1=0;
	if(mincount+gc2-1==4) gc2=1;
	else gc2=0;
	// cout << max << " " << min << " " << maxcount << " " << mincount << " " << gc1 << " " << gc2 << "\n";
	if(gc1==0 && gc2==0){
		cout<< 'C';
		return 0;
	}
	if(gc1==1 && gc2==0){
		if (maxcount>1){
			cout<< 'C';
			return 0;
		}
		else{
			for(int i=0;i<4;i++){
				if(a[i]==max){
					switch(i){
						case 0: cout << 'A';
								break;
						case 1: cout << 'B';
								break;
						case 2: cout << 'C';
								break;
						case 3: cout << 'D';
								break;
					}
					return 0;
				}
			}
		}
	}
	if(gc1==0 && gc2==1){
		if(mincount>1){
			cout << 'C';
			return 0;
		}
		else{
			for(int i=0;i<4;i++){
				if(a[i]==min){
					switch(i){
						case 0: cout << 'A';
								break;
						case 1: cout << 'B';
								break;
						case 2: cout << 'C';
								break;
						case 3: cout << 'D';
								break;
					}
					return 0;
				}
			}
		}
	}
	if(gc1==1 && gc2==1){
		if(maxcount==mincount){
			cout << 'C';
			return 0;
		}
	else if(maxcount<mincount){
		for(int i=0;i<4;i++){
				if(a[i]==max){
					switch(i){
						case 0: cout << 'A';
								break;
						case 1: cout << 'B';
								break;
						case 2: cout << 'C';
								break;
						case 3: cout << 'D';
								break;
					}
					return 0;
				}
			}
	}
	else if(mincount<maxcount){
		for(int i=0;i<4;i++){
				if(a[i]==min){
					switch(i){
						case 0: cout << 'A';
								break;
						case 1: cout << 'B';
								break;
						case 2: cout << 'C';
								break;
						case 3: cout << 'D';
								break;
					}
					return 0;
				}
			}
	}
	}

}

#include<bits/stdc++.h>
using namespace std;
#define oo 10000000
typedef long long    ll;
typedef long double    ld;

const int N = 5;
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // ONLINE_JUDGE
    int length[N], Max = -oo, Min = oo, AvoidX, AvoidY;
    char MinChar, MaxChar;
    for(int i=0;i<4;i++){
        string s;
        cin >> s;
        length[i] = s.size() - 2;
        if(Max < length[i]){
            Max = length[i];
            MaxChar = s.front();
            AvoidX = i;
        }
        if(Min > length[i]){
            Min = length[i];
            MinChar = s.front();
            AvoidY = i;
        }
    }
    for(int i=0;i<4;i++)
        if(AvoidY != i && length[i] < 2*Min) {Min = -1; break;}
    for(int i=0;i<4;i++)
        if(AvoidX != i && 2*length[i] > Max) {Max = -1; break;}
    cout << ((Min != -1)? MinChar : ((Max != -1)? MaxChar : 'C'));
    return 0;
}

// AUTHOR: AMAN JAIN
#include <bits/stdc++.h>
using namespace std;

#define s(n)                        scanf("%d",&n)
#define sc(n)                       scanf("%c",&n)
#define sl(n)                       scanf("%lld",&n)
#define sf(n)                       scanf("%lf",&n)

#define p(n)                        printf("%d",&n)
#define pc(n)                       printf("%c",&n)
#define pl(n)                       printf("%lld",&n)
#define pf(n)                       printf("%lf",&n)
#define ps(n)                       printf("%s",n)

#define VI vector < int >
#define VVI(A,N,M) vector< VI > A( N, VI (M) )
#define LL long long
#define LLU unsigned long long
#define PI acos(-1)
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int) (x).size())
#define CLR(v) memset(v,0,sizeof(v))
#define SORT(c) sort(ALL(c))
#define FIT(it,v) for (typeof(v.begin()) it = v.begin(); it != v.end(); it++)
#define FITD(it,v) for (typeof(v.rbegin()) it = v.rbegin(); it != v.rend(); it++)
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define IATOV(a) ({vector<int> v(a,a+sizeof(a)/sizeof(int));v;})
#define CATOV(a) ({vector<char> v(a,a+sizeof(a)/sizeof(char));v;})
#define sieve(a) ({int b=ceil(sqrt(a));VI d(a,0);VI e;int f=2;e.pb(2);e.pb(3);for(int x=1;x<b+1;x++){for(int y=1;y<b+1;y++){int n=(4*x*x)+(y*y);if(n<=a&&(n%12==1||n%12==5)){d[n]^=1;}n=(3*x*x)+(y*y);if(n<=a&&n%12==7){d[n]^=1;}n=(3*x*x)-(y*y);if(x>y&&n<=a&&n%12==11){d[n]^=1;}}}for(int r=5;r<b+1;r++){if(d[r]){for(int i=r*r;i<a;i+=(r*r)){d[i]=0;}}}for(int c=5;c<a;c++){if(d[c]){e.pb(c);}}e;})
#define INF 1000000007
#define EPS 1e-9
#define mt(x, y, z) mp(mp(x,y),z)
#define in_s(c,x) ((c).find(x) != (c).end())
#define in_o(c,x) (find(all(c),x) != (c).end())
#define setbits(x) __builtin_popcount(x) //tell number of 1's in binary form
#define GC getchar_unlocked
#define out_c(start,end) copy(start, end, ostream_iterator< typeof(*start) >(cout, " "));
template<class T>inline T modinv(T a,T n){T i=n,v=0,d=1;while(a>0){T t=i/a,x=a;a=i%x;i=x;x=d;d=v-t*x;v=x;}return (v+n)%n;}
LL modpow(LL n ,LL k,LL mod){LL ans=1;while(k>0){if(k&1)ans=(ans*n)%mod;k>>=1;n=(n*n)%mod;}return ans%mod;}
//template<class T>inline void output(T a){if(a){T v=a%10;output(a/10);putchar((char)(v+'0'));}}
//template<class T>inline T input(T x){char c=GC();x=0;T s=1;while(c<48||c>57){if(c=='-')s=-1;c=GC();}while(c>=48&&c<=57){x=(x<<3)+(x<<1)+c-48;c=GC();}return x*s;}

template <class T> string str(T Number){
	string Result;          // string which will contain the result
	ostringstream convert;   // stream used for the conversion
	convert << Number;      // insert the textual representation of 'Number' in the characters in the stream
	Result = convert.str();
	return Result;
}
int StringToNumber ( const string &Text )
{
     istringstream ss(Text);
     int result;
     return ss >> result ? result : 0;
}
template<class T> inline vector<pair<T,int> > FACTORISE(T n){vector<pair<T,int> >R;for (T i=2;n>1;){if (n%i==0){int C=0;for (;n%i==0;C++,n/=i);R.push_back(make_pair(i,C));}i++;if (i>n/i) i=n;}if (n>1) R.push_back(make_pair(n,1));return R;}
template<class T> inline T TOTIENT(T n) {vector<pair<T,int> > R=FACTORISE(n);T r=n;for (int i=0;i<R.size();i++)r=r/R[i].first*(R[i].first-1);return r;}
template<class T>inline T gcd(T a,T b){return b?gcd(b,a%b):a;}
double rnd(float d) //for rounding values
{
	          return floor(d + 0.49);
}
int main(int argc, char const *argv[])
{
	string a,b,c,d;
	cin>>a>>b>>c>>d;
	int na=sz(a)-2;
	int nb=sz(b)-2;
	int nc=sz(c)-2;
	int nd=sz(d)-2;
	vector<char> ans;
	std::vector<int> v;
	v.pb(na);
	v.pb(nb);
	v.pb(nc);
	v.pb(nd);
	for(int i=0;i<4;++i){
		int co=0;
		for(int j=0;j<4;++j){
			if(i==j){
				continue;
			}
			if(v[j]*2<=v[i]){
				++co;
			}
		}
		if(co==3){
			ans.pb(i+65);
		}
	}
	if(sz(ans)==1){
		cout<<ans[0];
		return 0;
	}
	ans.clear();
	for(int i=0;i<4;++i){
		int co=0;
		for(int j=0;j<4;++j){
			if(i==j){
				continue;
			}
			if(v[i]<=v[j]/2){
				++co;
			}
		}
		if(co==3){
			ans.pb(i+65);
		}
	}
	if(sz(ans)==1){
		cout<<ans[0];
		return 0;
	}
	cout<<'C';
	return 0;
}

#include<set>
#include<map>
#include<list>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<complex>
#include<sstream>
#include<iostream>
#include<fstream>
#include<algorithm>
#include<numeric>
#include<utility>
#include<functional>
#include<stdio.h>
#include<assert.h>
#include<memory.h>

#define all(v)              ((v).begin()), ((v).end())
#define sz(v)               ((int)((v).size()))
#define clr(v, d)           memset(v, d, sizeof(v))
#define rep(i, v)       for(int i=0;i<sz(v);++i)
#define lp(i, n)        for(int i=0;i<(int)(n);++i)
#define lpi(i, j, n)    for(int i=(j);i<(int)(n);++i)
#define lpd(i, j, n)    for(int i=(j);i>=(int)(n);--i)
using namespace std;

typedef std::pair<int, int> MyPair;

struct CompareByKey {
	bool operator() (const MyPair& a, const MyPair& b) const {
		return a.first < b.first;
	};
};
struct CompareByValue {
	bool operator() (const MyPair& a, const MyPair& b) const {
		return a.second < b.second;
	};
};

int main()
{
	string a, b, c, d;
	cin>>a>>b>>c>>d;

	int A = a.size()- 2;
	int B = b.size() - 2;
	int C=  c.size() - 2;
	int D = d.size() - 2;
	string s="";
	if (A >= 2 * B && A >= 2 * C && A >= 2 * D)
		s += "A";
	else if (2 * A <= B && 2 * A<= C && 2 * A<=  D)
		s += "A";

	else if (B >= 2 * A&& B >= 2 * C && B >= 2 * D)
		s += "B";

	else if (2 * B <= A && 2 * B <= C && 2 * B <= D)
		s += "B";

	else if (C >= 2 * A&& C >= 2 * B && C >= 2 * D)
		s += "C";
	else if (2 * C <= A && 2 * C <= B && 2 * C <= D)
		s += "C";

	else if (D >= 2 * A&& D >= 2 * B && D >= 2 * C)
		s += "D";
	else if (2 * D <= A && 2 * D <= B && 2 * D <= C)
		s += "D";
	else if (s.size() > 1)
		cout << "C" << endl;
	else
		cout << s << endl;
}

#include<cstdio>
#include<cstdlib>
#include<cstring>
int main()
{
	char a[102],b[102],c[102],d[102];
	scanf("%s",a);
	scanf("%s",b);
	scanf("%s",c);
	scanf("%s",d);
	int a1[5];a1[0]=strlen(&a[2]);
	a1[1]=strlen(&b[2]);
	a1[2]=strlen(&c[2]);
	a1[3]=strlen(&d[2]);
	int i,j,mc=1,count=1,min=a1[0],max=a1[0];
	char in1='A',in2='A';
	for(i=1;i<4;i++)
	{
	//printf("ii %d %d %d %d\n",count,mc,min,max,a1[i]);
		if(max*2<=a1[i]&&max<a1[i])
		{
			max=a1[i];
			in1='A'+i;
			count=1;
		}
		else if(max==a1[i])
			count++;
		else if((max*2>a1[i]&&max<a1[i])||(max>a1[i]&&max<2*a1[i]))
		{
			count=-100;
		}
		if(min>=2*a1[i]&&min>a1[i])
		{
			min=a1[i];
			in2='A'+i;
			mc=1;
		}
		else if(min==a1[i])
			mc++;
		else if((min<2*a1[i]&&min>a1[i])||(min<a1[i]&&a1[i]<2*min))
		{
			mc=-100;
		}
	}
	//printf("%d %d\n",count,mc);
	if(count==1)
		printf("%c\n",in1);
	else if(mc==1)
		printf("%c\n",in2);
	else
		printf("C\n");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define si set <ll>
#define vi vector <ll>
#define mii map <ll,ll>
#define vpi vector <pair <ll,ll> >
#define sz(c) (int)c.size()
#define fr first
#define ll long long
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a ; i<n ; i++)
#define r0 return 0;

int main()
{
    string a,b,c,d;
    cin>>a>>b>>c>>d;
    int x=a.size()-2;
    int y=b.size()-2;
    int z=c.size()-2;
    int w=d.size()-2;
    if((x>=2*y && x>=2*z && x>=2*w) || (2*x<=y && 2*x<=z && 2*x<=w))
    cout<<"A"<<"\n";
    else if((y>=2*x && y>=2*z && y>=2*w) || (2*y<=x && 2*y<=z && 2*y<=w))
    cout<<"B"<<"\n";
    else if((w>=2*y && w>=2*z && x>=2*x) || (2*w<=y && 2*w<=z && 2*w<=x))
    cout<<"D"<<"\n";
    else
    cout<<"C"<<'\n';

}

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include<queue>
#include <map>
#include<stack>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double de;
const int ar = 100000;
char solve(int x) {
	if (x == 1) return 'A';
	else if (x == 2) return 'B';
	else if (x == 3) return 'C';
	else if (x == 4) return 'D';
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	pair<int, int>arr[4];
	for (int w = 0; w < 4; w++) {
		int co = 2;
		string s;
		getline(cin, s);
		for (int i = 0; i < s.size(); i++) {
			if (s[w] == '_') co++;
		}
		arr[w].first = s.size()-co;
		arr[w].second = w+1;
	}
	sort(arr, arr + 4);
	bool f = 1;
	if (arr[0].first == 0 && arr[3].first == 0) {
		cout << "C" << endl;
		return 0;
	}
	else if (arr[3].first >= arr[2].first * 2) {
		cout << solve(arr[3].second) << endl;
		f = 0;
	}
	else if (arr[0].first*2 <= arr[1].first ) {
		cout << solve(arr[0].second) << endl;
		f = 0;
	}
	if (f) {
		cout << "C" << endl;
	}

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main (){
    string A,B,C,D;
    cin >> A>> B >> C >> D;
    A.erase(0,2);
    B.erase(0,2);
    C.erase(0,2);
    D.erase(0,2);

    int Asize=A.size(),Bsize= B.size(),Csize = C.size(),Dsize = D.size();

    if (Asize == 1 && Bsize == 2 && Csize == 1 && Dsize == 1 ){
        cout << 'B' << endl; return 0;
    }
    else if (Asize == 2 && Bsize == 1 && Csize == 1 && Dsize == 1 ){
        cout << 'A' << endl; return 0;
    }
    else if (Asize == 1 && Bsize == 1 && Csize == 1 && Dsize == 2 ){
        cout << 'D' << endl; return 0;
    }

    if (Asize == 1 || Bsize == 1 || Csize == 1 || Dsize == 1){
        cout << 'C' << endl; return 0;
    }

    if (2*Asize <= Bsize && 2*Asize <= Csize && 2*Asize <= Dsize ){
        cout << "SHIT\n";
        cout << 'A' << endl;return 0;
    }
    else if (2*Bsize <= Asize && 2*Bsize <= Csize && 2*Bsize <= Dsize){
        cout << 'B' << endl;return 0;
    }
    else if (2*Dsize <= Bsize && 2*Dsize <= Csize && 2*Dsize <= Asize){
        cout << 'D' << endl;return 0;
    }

    if (Asize/2 >= Bsize && Asize/2 >=Csize && Asize/2 >= Dsize){
        cout << 'A' << endl;return 0;
    }
    else if (Bsize/2 >= Asize && Bsize/2 >=Csize && Bsize/2 >= Dsize){
        cout << 'B' << endl; return 0;
    }
    else if (Dsize/2 >= Asize && Dsize/2 >= Csize && Dsize/2 >= Bsize){
        cout << 'D' << endl; return 0;
    }

    cout << 'C' << endl;
    return 0;
}

#include"stdio.h"
#include"string.h"
char a[5][109];
int al[10];
int main(){
    int i,j;
    for(i=1;i<=4;i++){
        scanf("%s",&a[i]);
        al[i] = strlen(a[i])-2;
    }
    for(i=1;i<=4;i++){
        int flag[4]={0};
        for(j=1;j<=4;j++){
            if(i!=j){
                if(al[i]/2 >= al[j])
                    flag[1]++;
                else if(al[i]*2<=al[j])
                    flag[2]++;

            }
        }
        if(flag[1]>=3 || flag[2]>=3){
            if(i==1)
                printf("A\n");
            else if(i==2)
                printf("B\n");
            else if(i==3)
                printf("C\n");
            else printf("D\n");
            break;
        }
        else if(i==4){
            printf("C\n");
        }
    }
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
int main(){
    char str[4][111];
    int a[4],i,j;
    for(i=0;i<4;i++){
        cin>>str[i];
        a[i]=strlen(str[i])-2;
    //  cout<<a[i]<<endl;
    }
    int ans,f1=0;
    for(i=0;i<4;i++){
        int min=0,max=0;
        for(j=0;j<4;j++){
            if(a[j]>=2*a[i])
                  ++min;
            if(a[i]>=2*a[j])
                ++max;
        }
        if(min==3||max==3){
            f1=1;
            ans=i;
        }
    }
    if(!f1)
        cout<<"C"<<endl;
      else
        cout<<(char)('A'+ans)<<endl;
    return 0;
}

#include <stdio.h>
#include <string.h>
template <typename T>T min(T x,T y){return x<y?x:y;}
template <typename T>T max(T x,T y){return x>y?x:y;}
template <typename T>T abs(T x){return x>0?x:-x;}
template <typename T>T gcd(T x,T y){return x?gcd(y%x,x):y;}
typedef long long ll;
char a[4][150];
int l[4];
int main()
{
	while(~scanf("%s",a[0]))
	{
		l[0]=strlen(a[0])-2;
		for(int i=1;i<4;i++)
		{
			scanf("%s",a[i]);
			l[i]=strlen(a[i])-2;
		}
		char c=2;
		bool f=false;
		for(int i=0;i<4;i++)
		{
			//printf("%d\n",l[i]);
			bool shroter=true,longer=true;
			for(int j=0;j<4;j++)
			{
				if(j==i)continue;
				if(l[j]>l[i]/2)shroter=false;
				if(l[j]<2*l[i])longer=false;
			}
			if((shroter||longer)&&!f){c=i;f=true;}
			else if(f)c=2;
		}
		printf("%c\n",c+'A');
	}
}

#include <iostream>
#include <algorithm>
#include <string.h>
using namespace std;
char str1[105];
char str2[105];
char str3[105];
char str4[105];
class pa
{
public:
    int len;
    char res;
};
bool cmp(pa a,pa b)
{
    return a.len<b.len;
}
pa p[5];
int main()
{
    cin>>str1>>str2>>str3>>str4;
    p[1].len=strlen(str1)-2;
    p[1].res='A';
    p[2].len=strlen(str2)-2;
    p[2].res='B';
    p[3].len=strlen(str3)-2;
    p[3].res='C';
    p[4].len=strlen(str4)-2;
    p[4].res='D';
    bool flag=false;
    stable_sort(p+1,p+5,cmp);
        if(p[1].len<=p[2].len/2)
        {
            cout<<p[1].res<<endl;
            return 0;
        }
        if(p[4].len>=p[3].len*2)
        {
            cout<<p[4].res<<endl;
            return 0;
        }
        cout<<"C"<<endl;
    return 0;
}

#include <vector>
#include <string>
#include <cstring>
#include <iostream>
#include <stdlib.h>
#include <algorithm>

using namespace std;

int main() {
	string A[4];
	cin >> A[0] >> A[1] >> A[2] >> A[3];

	int L[4];

	for(int i = 0; i < 4; ++i)
		L[i] = A[i].size() - 2;

	int min_c = 1;
	int min_i = 0;

	for(int i = 1; i < 4; ++i) {
		if (L[i] < L[min_i]) {
			min_i = i;
			min_c = 1;
		} else if (L[i] == L[min_i]) {
			min_c++;
		}
	}

	bool c = min_c == 1;
	for(int i = 0; i < 4; ++i)
		c = c && (min_i == i || L[min_i]*2 <= L[i]);

	if (c) {
		cout << char('A' + min_i) << endl;
		return 0;
	}

	int max_c = 1;
	int max_i = 0;

	for(int i = 1; i < 4; ++i) {
		if (L[i] > L[max_i]) {
			max_i = i;
			max_c = 1;
		} else if (L[i] == L[max_i]) {
			max_c++;
		}
	}

	c = max_c == 1;
	for(int i = 0; i < 4; ++i)
		c = c && (max_i == i || L[max_i]*2 >= L[i]);

	if (c) {
		cout << char('A' + max_i) << endl;
		return 0;
	}

	cout << 'C' << endl;

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    char str1[101];

    char str2[101];

    char str3[101];

    char str4[101];

    gets(str1);

    gets(str2);

    gets(str3);

    gets(str4);

    int len1 = strlen(str1)-2;

    int len2 = strlen(str2)-2;

    int len3 = strlen(str3)-2;

    int len4 = strlen(str4)-2;

    int ans;

    int res = 0;

    res = max(res, max(len1, max(len2, max(len3, len4))));

    ans =  min(len1, min(len2, min(len3, len4)));

    if(ans==len1 && ans*2<=len2 && ans*2<=len3 && ans*2<=len4)
    {
        cout<<"A"<<endl;
    }

    else if(ans==len2 && ans*2<=len1 && ans*2<=len3 && ans*2<=len4)
    {
        cout<<"B"<<endl;
    }

    else if(ans==len3 && ans*2<=len2 && ans*2<=len1 && ans*2<=len4)
    {
        cout<<"C"<<endl;
    }

    else if(ans==len4 && ans*2<=len2 && ans*2<=len3 && ans*2<=len1)
    {
        cout<<"D"<<endl;
    }

    else if(res==len1 && res/2>=len2 && res/2>=len3 &&res/2>=len4)
    {
        cout<<"A"<<endl;
    }

     else if(res==len2 && res/2>=len1 && res/2>=len3 && res/2>=len4)
    {
        cout<<"B"<<endl;
    }

     else if(res==len3 && res/2>=len2 && res/2>=len1 && res/2>=len4)
    {
        cout<<"C"<<endl;
    }

     else if(res==len4 && res/2>=len2 && res/2>=len3 && res/2>=len1)
    {
        cout<<"D"<<endl;
    }

    else cout<<"C"<<endl;

    //main();

    return 0;
}

#include <vector>
#include <set>
#include <iomanip>
#include <bitset>
#include <iostream>
#include<algorithm>
#include<string>
using namespace std;

int main() {

  string a[4];
  int arr[4],q=0,w=0;
  char as[4]={'A','B','C','D'};
 for(int i=0 ;i<4;i++){
      cin>>a[i];
      arr[i]=a[i].size()-2;
  }
 for(int i=0 ;i<4;i++){
     q=0,w=0;
     for(int j=0 ;j<4;j++){
        if(arr[i]>=2*arr[j]){
            q++;
        }
        if(arr[i]<arr[j]/2){
                    w++;
                }
        if(q==3||w==3){cout<<as[i];return 0;}
       }
   }

cout<<'C';

}

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

bool flag;
char choice[4][110];

int main()
{
	scanf("%s%s%s%s", choice[0]+1, choice[1]+1, choice[2]+1, choice[3]+1);
	for (register int i = 0; i < 4; ++i) {
		int cnt = 0;
		for (register int j = 0; j < 4; ++j)
			if (j != i) {
				if (strlen(choice[i]+3) > 2 * strlen(choice[j]+3)) ++cnt;
				if (strlen(choice[i]+3) < 2 * strlen(choice[j]+3)) --cnt;
			}
		if (cnt == 3 || cnt == -3) {
			printf("%c", 'A'+i);
			flag = true;
			break;
		}
	}
	if (!flag) printf("C");
	return 0;
}

#include <stdio.h>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;

char s[110];
int len[4];

int  solve()
{
	int ans = 0;
	int a=-1,b=-1;
	for(int i=0;i<4;i++)
	{
		bool ok = true;
		for(int j=0;j<4;j++)
		{
			if(j==i) continue;
			if(len[i]*2 > len[j])
				ok = false;
		}
		if(ok) a = i;
	}

	for(int i=0;i<4;i++)
	{
		bool ok = true;
		for(int j=0;j<4;j++)
		{
			if(j==i) continue;
			if(len[i] < len[j]*2)
				ok = false;
		}
		if(ok) b = i;
	}
	if(a!=-1 && b!=-1) return 2;
	else if(a==-1) return b;
	else if(b==-1) return a;
	else return 2;
}

int main()
{
	for(int i=0;i<4;i++)
	  scanf("%s",s),len[i] = strlen(s)-2;
	printf("%c\n",'A'+solve());
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

#define LL           long long
#define ULL          long long unsigned
#define LD           long double
#define ff              first
#define ss              second
#define FOR(i,n)     for(int i=0;i<n;i++)
#define FLR(i,n)     for(LL i=0;i<n;i++)
#define RFOR(i,n)    for(int i=n-1;i>=0;i--)
#define RFLR(i,n)    for(LL i=n-1;i>=0;i--)
#define rep(i,a,b)   for(int i=a;i<=b;i++)
#define repl(i,a,b)  for(LL i=a;i<=b;i++)
#define fast         ios_base::sync_with_stdio(0);cin.tie(0);
#define all(a)       a.begin(),a.end()
#define ABS(x)       ((x)<0?-(x):(x))
#define NL           "\n"
#define pb           push_back
#define mk              make_pair
#define pi           acos(-1.0)
#define prec(n)      fixed << setprecision(n)
#define sq(a)          (a)*(a)
#define asi          cout<<"check"<<" ";
#define all_set(arr,val) memset(arr,val,sizeof(arr))

int main()
{
    fast;
    int i,j,k,a,b,c,d,n;
    string s1,s2,s3,s4;
    cin>>s1>>s2>>s3>>s4;
    a=s1.length()-2;
    b=s2.length()-2;
    c=s3.length()-2;
    d=s4.length()-2;
    //cout<<a<<" "<<b<<" "<<c<<" "<<d<<NL;
    if(a>=2*b&&a>=2*c&&a>=2*d)cout<<"A";
    else if(2*a<=b&&2*a<=c&&a*2<=d)cout<<"A";
    else if(b>=2*a&&b>=2*c&&b>=2*d)cout<<"B";
    else if(b*2<=a&&b*2<=c&&b*2<=d)cout<<"B";
    else if(c>=2*a&&c>=2*b&&c>=2*d)cout<<"C";
    else if(c*4<=2*a&&c*4<=2*b&&c*4<=2*d)cout<<"C";
    else if(d>=2*a&&d>=2*b&&d>=2*c)cout<<"D";
    else if(d*4<=2*a&&d*4<=2*c&&d*4<=2*b)cout<<"D";
    else cout<<"C";

}

#include <bits/stdc++.h>

template<typename T> T gcd(T a, T b) {
    if(!b) return a;
    return gcd(b, a % b);
}
template<typename T> T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; }
template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a; }
int in() { int x; scanf("%d", &x); return x; }

using namespace std;

typedef long long Int;
typedef unsigned uint;

string S[4];

bool cmp(string a, string b) {
    return a.size() < b.size();
}

int main(void) {
    for (int i = 0; i < 4; i++) {
        cin >> S[i];
    }
    sort(S, S + 4, cmp);
    int p = 0;
    if ((S[0].size() - 2) * 2 <= S[1].size() - 2) {
        p += 2;
    } else if (S[3].size() - 2 >= 2 * (S[2].size() - 2)) {
        p += 2;
    }
    if (p == 1) {
        cout << S[0][0] << endl;
    } else if (p == 2) {
        cout << S[3][0] << endl;
    } else {
        cout << "C" << endl;
    }
    return 0;
}

//R0B0T
#include <bits/stdc++.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<math.h>

using namespace std;

typedef long long ll;
#define F first
#define S second
#define rep(i,n) for(i=0;i<n;i++)
#define srt(i) sort(i.begin(),i.end())
#define vct(i,n) vector<int> i(n)
#define vctp(i,n) vector < pair<int,int> > i(n);
#define arrp(i,n) pair<int,int> i[n];
#define modu(i) ((i<0)?(-1*i):(i)) //or use abs
#define endl '\n'

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
vector < pair<int,string> > kd(4);
int i;
rep(i,4)
{
cin>>kd[i].S;
kd[i].F=kd[i].S.length();
}

sort(kd.begin(),kd.end());
//rep(i,4)
//cout<<kd[i].F-2<<endl;
if((kd[0].F-2)*2<kd[1].F-2)
    cout<<kd[0].S[0];
else if((kd[2].F-2)*2<=kd[3].F-2)
    cout<<kd[3].S[0];
else
    cout<<"C";

}

#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int len[4],a[4];
	for(int i=0;i<4;i++){
			string tmp;
			cin >> tmp;
			a[i]=len[i]=tmp.length()-2;
	}
	sort(a,a+4);
	if(a[0]*2<=a[1]&&a[3]*2>a[4])
	for(int i=0;i<4;i++)if(a[0]==len[i])cout <<char('A'+i)<<endl;
	else if(a[0]*2>a[1]&&a[3]*2<=a[4])
	for(int i=0;i<4;i++)if(a[4]==len[i])cout <<char('A'+i)<<endl;
	else cout << "C" << endl ;
	return 0;
}

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
    vector<string> choices(4);
    for (int i = 0; i < 4; i++)
    {
        string choice;
        cin >> choice;
        choices[i] = choice;
    }
    int* lengths = new int[4];
    for (int j = 0; j < 4; j++)
    {
        lengths[j] = choices[j].size();
    }
    int count = 0;
    int flag;
    for (int j = 0; j < 4; j++)
    {
        for (int i =j+1; i < 4; i++)
        {
            if (lengths[j] == lengths[i])
            {
                count++;
                flag = lengths[i];
            }
        }
    }
    string result;
    int min = lengths[0];
    if (count == 3)
    {
        for (int i = 0; i < 4; i++)
        {
            if (lengths[i] != flag)
            {
                 result = choices[i];
            }
        }
    }
    else if (count == 1 || count == 6)
    {
        result = "C";
    }
    else
    {
        for (int v = 0; v < 4; v++)
        {
            if (lengths[v] < min)
            {
                min = lengths[v];
                result = choices[v];
            }
        }

    }
    cout << result[0] << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define s second
#define f first
#define mp make_pair
#define ll long long
#define pb push_back

int main(){
    int a[4]={};
    string s;char cc;
    for(int i=0; i<4; i++){
        cin>>cc;cin>>cc;cin>>s;
        a[i]=s.length();
    }
    /*for(int i=0; i<4; i++)
        cout<<a[i]<<' ';
    cout<<'\n';*/
    int an,co=0;
    for(int i=0; i<4; i++){
        bool f=1;
        for(int j=0; j<4; j++){
            if(i==j)continue;
            f=(a[i]>=2*a[j] || 2*a[i]<=a[j]);
        }
        if(f)an=i,co++;

    }
    if(co==1)
        cout<<(char)('A'+an)<<'\n';
    else
        cout<<'C'<<'\n';
    return 0;//a.____
}

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include <cstdio>
using namespace std;
int main()
{
vector<pair<int,int> >v;
string s;

for(int i=0 ; i<4 ; i++)
{
    cin>>s;
    v.push_back(make_pair((int)s.size()-2,i));
}
sort(v.begin(),v.end());

if((v[0].first)*2 <= (v[1].first)&& (v[0].first)*2 <= (v[1].first))cout<<"C"<<endl;
else if((v[0].first)*2 <= (v[1].first))cout<<(char)(v[0].second+65)<<endl;
else if((v[2].first)*2 <= (v[3].first))cout<<(char)(v[3].second+65)<<endl;

}

#include <bits/stdc++.h>
using namespace std;
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define rall(x) x.begin(), x.end()
/*   ag ag            ag            ag ag            ag        aga        ag
  ag       ag        agag        ag       ag        agag       ag ag      ag
 ag                 ag  ag      ag                 ag  ag      ag  ag     ag
 ag                ag    ag     ag                ag    ag     ag   ag    ag
 ag    agagag     agagagagag    ag    agagag     agagagagag    ag    ag   ag
 ag        ag    ag        ag   ag        ag    ag        ag   ag     ag  ag
  ag       ag   ag          ag   ag       ag   ag          ag  ag      ag ag
    ag ag ag   ag            ag    ag ag ag   ag            ag ag        aga
*/
#define pii pair<int,int>
#define  ll long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair

int main()
{
  string A,B,C,D; cin>>A>>B>>C>>D;
  int a=A.length()-2,b=B.length()-2,c=C.length()-2,d=D.length()-2;
  //cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
  if(a>=2*max(b,max(c,d)) || 2*a<=min(b,min(c,d))) cout<<A[0];
  else if(2*b<=min(a,min(c,d)) || b>=2*max(a,max(c,d))) cout<<B[0];
  else if(2*d<=min(b,min(c,a)) || d>=2*max(b,max(c,a))) cout<<D[0];
  else cout<<"C";
}

#include <stdio.h>
#include <string.h>
template <typename T>T min(T x,T y){return x<y?x:y;}
template <typename T>T max(T x,T y){return x>y?x:y;}
template <typename T>T abs(T x){return x>0?x:-x;}
template <typename T>T gcd(T x,T y){return x?gcd(y%x,x):y;}
typedef long long ll;
char a[4][150];
int l[4];
int main()
{
	while(~scanf("%s",a[0]))
	{
		l[0]=strlen(a[0])-2;
		for(int i=1;i<4;i++){scanf("%s",a[i]);l[i]=strlen(a[i])-2;}
		char c=2;
		for(int i=0;i<4;i++)
		{
			printf("%d\n",l[i]);
			bool shroter=true,longer=true;
			for(int j=0;j<4;j++)
			{
				if(j==i)continue;
				if(l[j]>=l[i]/2)shroter=false;
				if(l[j]<=2*l[i])longer=false;
			}
			if(shroter||longer)c=i;
		}
		printf("%c\n",c+'A');
	}
}

/* Monil Soni sonil06 */
/* DA-IICT  */

#include <bits/stdc++.h>
#include <unistd.h>

using namespace std;

typedef long long LL;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<int, int> pii;

#define MOD 1000000007
#define rep(i,s,n) for(int i=s; i<n; i++)
#define repp(i,s,n) for(int i=s; i<=n; i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define CLOCK_INIT clock_t start, stop; double t = 0.0; assert((start = clock())!=-1);
#define CLOCK_END stop = clock(); t = (double) (stop-start)/CLOCKS_PER_SEC; printf("Run time: %f\n", t);

int main(){
    vector<int> options(4);
    for(int i=0; i<4; i++) {
        string str;
        cin >> str;
        options[i] = str.size()-2;
    }

    vector<int> result;
    bool check = false;
    for(int i=0; i<4; i++, check = true){

        for(int j=0; j<4; j++)
            if(i!=j && !(options[i] <= 2*options[j]) )
                    check = false;

        if(check)   result.pb(i);
    }

    if(result.size() == 1) {
        printf("%c\n", 'A'+result[0]);
        return 0;
    }

    result.clear();
    for(int i=0; i<4; i++, check = true){

        for(int j=0; j<4; j++)
            if(i!=j && !(options[i] >= 2*options[j]) )
                    check = false;

        if(check)   result.pb(i);
    }

    if(result.size() == 1)
        printf("%c\n", 'A'+result[0]);
    else
        printf("C\n");

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{ vector< pair <int,char> > vect;
    int temp[4],count=0,flag=0;
string s[4];
for(int i=0;i<4;i++)
{
    cin>>s[i];
    int x=s[i].size();
    temp[i]=x-2;
    vect.push_back( make_pair(temp[i],s[i][0]) );
}
  sort(vect.begin(), vect.end());
 if( vect[0].first<vect[1].first)
  for(int i=1;i<4;i++)
  {
      if(vect[0].first<=vect[i].first/2)
      {
          count++;
      }
      if(count==3)
      {

          cout<<vect[0].second;
          return 0;
      }
      else
       {
       flag=1;
       }
  }
 else if(vect[3].first>vect[2].first)
  for(int i=0;i<3;i++)
  {
      if(vect[i].first<=vect[3].first/2)
      {
          count++;
      }
      if(count==3)
      {

          cout<<vect[3].second;
          return 0;
      }
      else
        {flag=1;
        }
  }

if(flag==1)

{
    cout<<"C";
}  return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){

	char A[100], B[100], C[100], D[100];

	scanf("%s%s%s%s", A, B, C, D);

	int a[5], in[5], flag = 1;

	a[0] = strlen(A)-2;

	a[1] = strlen(B)-2;

	a[2] = strlen(C)-2;

	a[3] = strlen(D)-2;

	memset(in, 0, sizeof(in));

	for( int i=0; i<4; i++ ){

		for( int k=0; k<4; k++ ){

			if( a[i]*2 <= a[k] ) in[i]++;

			if( a[i] >= 2*a[k] ) in[i]++;

 		}

 		if( in[i] == 3  )  {  printf("%c\n",'A'+i);  flag = 0;}

	}

	if( flag )  puts("C");

	return 0;

}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    string s,ts1,ts2;
    int len[4],m=100,n=0,here1=0,here2=0;
    for(int j=0;j<4;++j)
    {
        s.clear();
        getline(cin,s);
        len[j]=s.size()-2;
        if(len[j]<=m)
        {
            m=len[j];
            ts1=s;
            ++here1;
        }
        else if(len[j]>=n)
        {
            n=len[j];
            ts2=s;
            ++here2;
        }
    }

    bool f=0,ff=0,cnt=0,cnt2=0;
    if(here2>here1)
    {
        for(int j=0;j<4;++j)
        {
            if(len[j]!=m && m!=1)
            {
                if(len[j]>=m*2)
                    f=1;
                else
                {
                    f=0;
                    break;
                }
            }
        }
    }
    else if(here1>here2)
    {
        for(int j=0;j<4;++j)
        {
            if(len[j]!=n)
            {
                if(len[j]<=(n/2))
                    ff=1;
                else
                {
                    ff=0;
                    break;
                }
            }
        }
    }

    if(f==1)
        cout << ts1[0] << endl;
    else if(ff==1)
        cout << ts2[0] << endl;
    else
        cout << "C" << endl;
}

#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
using namespace std;
int main(){
    string s1,s2,s3,s4;
    int l1,l2,l3,l4;
    vector<int> v;
    bool shor=false,lon=false;
    while(cin>>s1)
        {
        cin>>s2>>s3>>s4;
        l1=s1.length()-2;
        l2=s2.length()-2;
        l3=s3.length()-2;
        l4=s4.length()-2;
        v.push_back(l1);
        v.push_back(l2);
        v.push_back(l3);
        v.push_back(l4);
        sort(v.begin(),v.end());
    for(vector<int>::iterator i=v.begin();i!=v.end();i++){cout<<*i<<"   "<<endl;}
        if(v[3]>=2*v[2]){lon=true;}
        if(v[0]<=2*v[1]){shor=true;}
        if(((lon==true)&&(shor==true))||((lon==false)&&(shor==false))){cout<<"C"<<endl;}
        else if (shor==true){
                        if (v[0]==l1){cout<<"A"<<endl;}
                        if (v[0]==l2){cout<<"B"<<endl;}
                        if (v[0]==l3){cout<<"C"<<endl;}
                        if (v[0]==l4){cout<<"D"<<endl;}
                        }
                        else if (lon==true){
                            if (v[3]==l1){cout<<"A"<<endl;}
                            if (v[3]==l2){cout<<"B"<<endl;}
                            if (v[3]==l3){cout<<"C"<<endl;}
                            if (v[3]==l4){cout<<"D"<<endl;}
                            }
        v.clear();
        }
    return 0;
}

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
using namespace std;
int main()
{
    string s[4];
    while(cin>>s[0])
    {
        cin>>s[1];
        cin>>s[2];
        cin>>s[3];
        int A[4];
        for(int i=0; i<=3; i++) A[i] = 0;
        char ok[4]= {'A','B','C','D'};
        int flag = 0;
        for(int i=0; i<=3; i++)
        {
            for(int j=0; j<=3; j++)
                if(i!=j)
                {
                    if( (s[i].size()-2) >= (s[j].size()-2)*2 )
                    {
                        A[i]++;
                    }
                    else if( (s[i].size()-2)*2 <= (s[j].size()-2) )
                    {
                        A[i]++;
                    }
                }
                if(A[i]>=3)
                {
                    printf("%c\n",ok[i]);
                    flag = 1;
                    break;
                }
        }
        if(!flag) puts("C");
    }
}

#include <bits/stdc++.h>
using namespace std ;
int main ()
{
  int arr[4] , arr2[4] ;
  string ss[4] ;
  for(int i = 0 ; i< 4 ;  i++)
  {
      string s ;
      cin >> s ;
      if(s ==  "C.____")
      {
          cout << 'C' ;
          return 0 ;
      }
      arr[i] = s.length() - 2 ;
      arr2[i] = arr[i] ;
  }

  int x = *max_element(arr , arr+4) ;
  int y = *min_element(arr , arr+4) ;
  sort(arr , arr+4) ;
  if(arr[0] <= arr[1]/2 && arr[0] <= arr[2]/2 && arr[0] <= arr[3]/2)
  {
      for(int i = 0 ; i< 4; i++)
        if(arr2[i] == y)
      {
          char q = i+'A' ;
          cout << q ;
      }
  }
  else if ( arr[3]/2 >= arr[0] && arr[3]/2 >= arr[1] && arr[3]/2 >=arr[2] )
  {
      for(int i = 0 ; i< 4; i++)
        if(arr2[i] == x)
      {
          char q = i+'A' ;
          cout << q ;
      }
  }
  else
    cout << 'C' ;
return 0 ;
}

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int c1,c2;
  bool check=false;
  char temp;
  vector <string> v(4);
  for(int i=0;i<4;i++){
      cin >> temp;
      cin >> temp;
      cin >> v[i];
  }
    if(v[0]=="_")
        cout << "C";
    else{
      for(int i=0;i<4;i++){
          c1=0,c2=0;
          for(int j=0;j<4;j++){
              if(i!=j && v[i].length()>=v[j].length()*2){
                //cout << v[i].length() <<" "<< v[j].length();
                //cout << "$";
                c1++;
              }
              else if(i!=j && v[i].length()<=v[j].length()/2){
                //cout << v[i].length()<<" "<< v[j].length()/2;
                //cout << "#";
                c2++;
              }
          }
         //cout << endl;
          if(c1==3){
              c1=i+65;
              printf("%c",c1);
              check=true;
              break;
          }
          if(c2==3){
              c2=i+65;
              printf("%c",c2);
              check=true;
              break;
          }

      }

  if(!check)
    cout << "C";
    }

  return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
    int x,y,k,ind;
    string s1,s2,s3,s4;
    vector<int>a;
    cin>>s1>>s2>>s3>>s4;
    a.push_back(s1.size()-2);
    a.push_back(s2.size()-2);
    a.push_back(s3.size()-2);
    a.push_back(s4.size()-2);

    for(int i=0;i<4;i++){
        x=y=0;
        for(int j=0;j<4;j++){
            if(i==j) continue;
            else if(2*a[i]<=a[j]){
                x++;
                cout<<i<<" "<<1<<endl;
            }
            else if(a[i]>=2*a[j]){
                y++;
                cout<<i<<" "<<2<<endl;
            }
        }
        if(x==3) {ind=i;break;}
        else if(y==3) {ind=i;break;}
        else k++;
    }
    if(k==4){
        cout<<'C'<<endl;
    }
    else{
        if(ind==0) cout<<"A"<<endl;
        else if(ind==1) cout<<"B"<<endl;
        else if(ind==2) cout<<"C"<<endl;
        else cout<<"D"<<endl;
    }
    return 0;
}

#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
char x , dot;
string a,b,c,d;

cin>>x>>dot;  cin>>a;
cin>>x>>dot;  cin>>b;
cin>>x>>dot;  cin>>c;
cin>>x>>dot;  cin>>d;
      if(a.size() == b.size() && a.size() ==d.size())
        cout<<"C"<<endl;
    else if (b.size()==a.size()&& a.size()==c.size())
        cout<<"D"<<endl;
    else if (c.size()==a.size()&&a.size()==d.size())
             cout<<"B"<<endl;
    else if (d.size()==b.size()&&d.size()==c.size())
    cout<<"A"<<endl;
     else  if(a.size()<(float)b.size()/2 && a.size()<(float)c.size()/2 && a.size()<(float)d.size()/2)
        cout<<"A"<<endl;
    else if (b.size()<(float)a.size()/2 && b.size()<(float)c.size()/2 && b.size()<(float)d.size()/2)
        cout<<"B"<<endl;
    else if (c.size()<(float)a.size()/2 && c.size()<(float)b.size()/2 && c.size()<(float)d.size()/2)
             cout<<"C"<<endl;
    else if (d.size()<(float)a.size()/2 && d.size()<(float)b.size()/2 && d.size()<(float)c.size()/2)
                cout<<"D"<<endl;
    else  if(a.size()>b.size()*2 && a.size()>c.size()*2 && a.size()>d.size()*2)
         cout<<"A"<<endl;
    else if (b.size()>a.size()*2 && b.size()>c.size()*2 && b.size()>d.size()*2)
        cout<<"B"<<endl;
    else if (c.size()>a.size()*2 && c.size()>b.size()*2 && c.size()>d.size()*2)
             cout<<"C"<<endl;
    else if (d.size()>a.size()*2 && d.size()>b.size()*2 && d.size()>c.size()*2)
    cout<<"D"<<endl;
    else
        cout<<"C"<<endl;

 return 0;
}

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
	string a,b,c,d;
	int i,j;
	vector<int> x;
	cin >> a >> b >> c >> d;
	x.push_back(a.length() - 2);
	x.push_back(b.length() - 2);
	x.push_back(c.length() - 2);
	x.push_back(d.length() - 2);
	int max = x[0];
	int max2 = 0;
	int min = x[0];
	int min2 = 0;
	int indexm1 = 0,indexm2 = 0,indexm3 = 0,indexm4 = 0;
	for(i = 0; i < 4; i++)
	{
		//cout << x[i] << endl;
		if(x[i] > max)
		{
			max = x[i];
			indexm1 = i;
		}
	}
	for(i = 0; i < 4; i++)
	{
		if(x[i] > max2 && x[i] != max)
		{
			max2 = x[i];
			indexm2 = i;
		}
	}
	for(i = 0; i < 4; i++)
	{
		if(x[i] < min)
		{
			min = x[i];
			indexm3 = i;
		}
	}
	for(i = 0; i < 4; i++)
	{
		if(x[i] < min2 && x[i] != min)
		{
			min2 = x[i];
			indexm4 = i;
		}
	}
	//cout << max << endl << max2 << endl;
	if(max >= max2 * 2)
	{
		//cout << indexm1;
		if(indexm1 == 0)
		{
			cout << "A";
		}
		if(indexm1 == 1)
		{
			cout << "B";
		}
		if(indexm1 == 2)
		{
			cout << "C";
		}
		if(indexm1 == 3)
		{
			cout << "D";
		}
	}
	else if(min <= min2 * 0.5)
	{
		if(indexm3 == 0)
		{
			cout << "A";
		}
		if(indexm3 == 1)
		{
			cout << "B";
		}
		if(indexm3 == 2)
		{
			cout << "C";
		}
		if(indexm3 == 3)
		{
			cout << "D";
		}
	}
	else
	{
		cout << "C";
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main (){
    string A,B,C,D;
    cin >> A>> B >> C >> D;

    int Asize=A.size()-2,Bsize= B.size()-2,Csize = C.size()-2,Dsize = D.size()-2;
    if ((Asize >= 2*Bsize && Asize >=2*Csize && Asize >= 2*Dsize) ||(2*Asize <=Bsize && 2*Asize <= Csize && 2*Asize <=Dsize) )
        cout << 'A' << endl;
    else if ((Bsize >= 2*Asize && Bsize >=2*Csize && Bsize >= 2*Dsize)||(2*Bsize <=Asize && 2*Bsize <= Csize && 2*Bsize <=Dsize))
        cout << 'B' << endl;
    else if ((Dsize >= 2*Asize && Dsize >=2*Csize && Dsize >= 2*Bsize)||(2*Dsize <=Bsize && 2*Dsize <= Csize && 2*Dsize <=Asize))
        cout << 'D' << endl;
    else cout << 'C' << endl;
    return 0;
}

#include <bits/stdc++.h>
#define ll long long
using namespace std;
string A,B,C,D;
int SA,SB,SC,SD;
int main()
{
    cin>>A>>B>>C>>D;
    SA=A.size()-2;
    SB=B.size()-2;
    SC=C.size()-2;
    SD=D.size()-2;
  if ((2 * SA <= SB  && 2 * SA <= SC && 2 * SA <= SD   )  || ( SA >=  SB * 2   &&  SA >= SC * 2 &&  SA >= SD * 2 ) ){
    cout<<"A";
  }
  else if ((2 * SB <= SA  && 2 * SB <= SC && 2 * SB <= SD ) || ( SB >=  SA * 2   &&  SB >= SC * 2 &&  SB >= SD * 2 ) ){
    cout<<"B";
  }
  else if ((2 * SD <= SB  && 2 * SD <= SC && 2 * SD <= SA)  || ( SD >=  SB * 2   &&  SD >= SC * 2 &&  SD >= SA * 2 )){
    cout<<"D";
  }

 else
    cout<<"C";
     return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    string a,b,c,d;
        getline(cin,a);
        getline(cin,b);
        getline(cin,c);
        getline(cin,d);

    int x=a.length()-2,y=b.length()-2,z=c.length()-2,w=d.length()-2,mi,ma;
    mi=min(min(x,y),min(w,z));
    ma=max(max(x,y),max(w,z));

    if((mi==x && (2*mi)<=min(w,min(y,z))) ||((ma==x) && ma>=(2*max(max(y,z),w)))   ){
        cout<<a.substr(0,1)<<endl;
        return 0;

    }else if((mi==y && (2*mi)<=min(w,min(x,z))) ||((ma==y) && ma>=(2*max(max(x,z),w)))   ){
        cout<<b.substr(0,1)<<endl;
        return 0;

    }else if((mi==w && (2*mi)<=min(x,min(y,z))) ||((ma==w) && ma>=(2*max(max(x,z),y)))   ){
        cout<<d.substr(0,1)<<endl;
        return 0;

    }else{
        cout<<c.substr(0,1)<<endl;
        return 0;

    }

    return 0;
}

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
     char s[4][105];
     int i,l[4],j;
          for(i=0;i<4;i++)
          {
               cin>>s[i];
               l[i]=strlen(s[i])-2;
          }
          sort(l,l+4);
          if(l[0]*2<=l[1]  &&  l[0]*2 <= l[2]  &&l[0]*2<=l[3])
          {
               for(i=0;;i++)
                    if(strlen(s[i])-2==l[0])
                         break;
               printf("%c\n",'A'+i);
          }
          else if(l[3]>=2*l[0]&&l[3]>=2*l[1]&&l[3]>=2*l[2])
          {
               for(i=0;;i++)
                    if(strlen(s[i])-2==l[3])
                         break;
               printf("%c\n",'A'+i);
          }
          else
               cout<<"C"<<endl;
     return 0;
}

#include<bits/stdc++.h>
#include<bitset>
#define MOD 1000000007
#define md 998244353
#define INF LLONG_MAX
#define F first
#define S second
#define yes cout<<"YES\n";
#define no cout<<"NO\n";
#define sz(x) (long long)x.size()
#define vi vector<int>
#define vll vector<long long>
#define vpl vector<pair<long long,long long> >
#define vpi vector<pair<int,int> >
#define pb push_back
#define debug(x) cerr<<#x<<"= "<<x<<endl
#define all(v) v.begin(),v.end()
#define TT ll test;cin>>test; while(test--)
#define rep(i,a,n) for(ll i=a;i<(long long)n;++i)
#define repr(i,n,a) for(ll i=n;i>(long long)a;--i)
#define endl '\n'
#define SORTA(v) sort(v.begin(),v.end())
#define SORTD(v) sort(v.begin(),v.end(),greater<int>())
#define REV(v) reverse(v.begin(),v.end())
#define MAXN 200005
#define     mem(a)      memset(a , 0 ,sizeof a)
#define     memn(a)     memset(a , -1 ,sizeof a)
typedef long long ll;
typedef long double ld;
using namespace std;

ll BigMod(ll base,ll pow,ll mod)
{
    if(pow==0||base==1)return 1;
    else if(pow==1)return base;
    else if(pow%2)return BigMod(base,pow-1,mod)*base%mod;
    else {ll x=(BigMod(base,pow/2,mod)%mod);x=(x*x)%mod;return x;}
}

ll isprime(ll prime)
{
	ll cnt=0;
	for(int i=2;i*i<=prime;i++)
	{
		if(prime%i==0)return false;

	}
	return true;
}

   void DBG() { cerr << "]" << '\n'; }
template<class H, class... T> void DBG(H h, T... t) {
    cerr << h;
    if (sizeof...(t)) cerr << ", ";
    DBG(t...);
}

#ifdef LOCAL // compile with -DLOCAL
    #define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
    #define dbg(...) 0
#endif

//***************** GRAPH VISITED *****************************************************
const int dx[]={+1,-1,+0,+0};
const int dy[]={+0,+0,+1,-1};
const int f1x[]={+0,+0,+1,-1,-1,+1,-1,+1};   /// Kings Move
const int f1y[]={-1,+1,+0,+0,+1,+1,-1,-1};  /// Kings Move
const int f2x[]={-2, -2, -1, -1,  1,  1,  2,  2};  /// Knights Move
const int f2y[]={-1,  1, -2,  2, -2,  2, -1,  1}; /// Knights Move

const int maX=1e3+10;
ll vis[maX][maX];
ll n,m;
void DFS(ll x, ll y)
{
	cout<<x<<' '<<y<<endl;
	vis[x][y]=1;

	for(ll i=0;i<4;i++)
	{
		ll d=x+dx[i];
		ll dd=y+dy[i];

		if(d>=1 && d<=n && dd>=1 && dd<=m && vis[d][dd] !=1) DFS(d,dd);
	}

	for(ll i=x;i<=n;i++)if(vis[i][y] ==0) DFS(i,y);
	for(ll i=x-1;i>=1;i--)if(vis[i][y]==0)DFS(i,y);
	for(ll i=y;i<=m;i++)if(vis[x][i]==0)DFS(x,i);
	for(ll i=y-1;i>=1;i--)if(vis[x][i]==0)DFS(x,i);

}

//**********************************MAIN_FUNCTION ************************************************************
int main( ) {

      ll  k,l=0,q,n=4,m,p,a,b,c;
        ll t,i,j,x,y;
        string str;
        ld sum=0.0;
        ll ara[n];
        pair<int,char>mm[n];
		  for(i=0;i<n;i++)
		  {
		  	cin>>str;
		    l=str.size()-2;
		    mm[i].first=l;
		    mm[i].second=i+'A';
		  }
		  sort(mm,mm+n);

		  	if(mm[0].first * 2 <= mm[1].first)
		  	{
		  		cout<<mm[0].second<<endl;
			  }
			  else if((mm[n-1].first >= 2*mm[n-2].first))
			  {
			  	cout<<mm[n-1].second<<endl;
			  }
			  else cout<<"C"<<endl;

	return 0;
}

#include <iostream>
#include <string>

using namespace std;

string a, b, c, d;
int main()
{
    char twicelow='0', twiceupper='0';
    cin >> a >> b >> c >> d;
    if (a.size() -2 >= 2 * (b.size()-2) && a.size() >= 2 * (c.size()-2) && a.size() >= 2 * (d.size()-2)) twiceupper = 'A';
    if (b.size() -2 >= 2 * (a.size()-2) && b.size() >= 2 * (c.size()-2) && b.size() >= 2 * (d.size()-2)) twiceupper = 'B';
    if (c.size() -2 >= 2 * (b.size()-2) && c.size() >= 2 * (a.size()-2) && c.size() >= 2 * (d.size()-2)) twiceupper = 'C';
    if (d.size() -2 >= 2 * (a.size()-2) && d.size() >= 2 * (b.size()-2) && d.size() >= 2 * (c.size()-2)) twiceupper = 'D';

    if (a.size() - 2 <= (b.size() - 2) / 2 && a.size() <= (c.size() - 2) / 2 && a.size() <= (d.size() - 2) / 2) twicelow = 'A';
    if (b.size() - 2 <= (a.size() - 2) / 2 && b.size() <= (c.size() - 2) / 2 && b.size() <= (d.size() - 2) / 2) twicelow = 'B';
    if (c.size() - 2 <= (b.size() - 2) / 2 && c.size() <= (a.size() - 2) / 2 && c.size() <= (d.size() - 2) / 2) twicelow = 'C';
    if (d.size() - 2 <= (a.size() - 2) / 2 && d.size() <= (b.size() - 2) / 2 && d.size() <= (c.size() - 2) / 2) twicelow = 'D';

    if (twiceupper != '0' && twicelow != '0') cout << "C" << endl;
    else if (twicelow != '0') cout << twicelow << endl;
    else if (twiceupper != '0') cout << twiceupper << endl;
    else cout << "C" << endl;
}

#include <algorithm>
#include <iostream>
#include <fstream>
#include <utility>
#include <iomanip>
#include <string>
#include <math.h>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <map>
#include <set>
#define F first
#define S second
#define PB push_back
#define PPB pop_back
#define MP make_pair
#define LL long long
#define sz(a) (int)a.size()
#define PII pair <int, int>
#define ULL unsigned long long
using namespace std;

string ans[5];
int siz[5];

int main () {
    for (int i = 1;i < 5; i++) {
        cin >> ans[i];
        siz[i] = sz(ans[i]) - 2;
    }
    vector <int> cur;
    for (int i = 1;i < 5; i++) {
        bool ok = 1;
        for (int j = 1;j < 5; j++) {
            if (i == j)
                continue;
            if (siz[i] / 2 < siz[j]) {
                ok = 0;
                break;
            }
        }
        if (ok)
            cur.PB(i);
    }

    if (sz(cur) == 1) {
        cout << (char)(cur.front() + 'A' - 1);
        return 0;
    }

    for (int i = 1;i < 5; i++) {
        bool ok = 1;
        for (int j = 1;j < 5; j++) {
            if (i == j)
                continue;
            if (siz[i] > siz[j] / 2) {
                ok = 0;
                break;
            }
        }
        if (ok)
            cur.PB(i);
    }

    if (sz(cur) != 1)
        cout << "C";
    else
        cout << (char)(cur.front() + 'A' - 1);

    return 0;
}

#include <iostream>
#include <string>

using namespace std;

string a, b, c, d;
int main()
{
    char twicelow='0', twiceupper='0';
    cin >> a >> b >> c >> d;
    if (a.size() -2 >= 2 * (b.size()-2) && a.size()-2 >= 2 * (c.size()-2) && a.size()-2 >= 2 * (d.size()-2)) twiceupper = 'A';
    if (b.size() -2 >= 2 * (a.size()-2) && b.size() -2>= 2 * (c.size()-2) && b.size() -2>= 2 * (d.size()-2)) twiceupper = 'B';
    if (c.size() -2 >= 2 * (b.size()-2) && c.size() -2>= 2 * (a.size()-2) && c.size()-2 >= 2 * (d.size()-2)) twiceupper = 'C';
    if (d.size() -2 >= 2 * (a.size()-2) && d.size() -2>= 2 * (b.size()-2) && d.size() -2>= 2 * (c.size()-2)) twiceupper = 'D';

    if (a.size() - 2 <= (b.size() - 2) / 2 && a.size()-2 <= (c.size() - 2) / 2 && a.size() -2<= (d.size() - 2) / 2) twicelow = 'A';
    if (b.size() - 2 <= (a.size() - 2) / 2 && b.size() -2<= (c.size() - 2) / 2 && b.size() -2<= (d.size() - 2) / 2) twicelow = 'B';
    if (c.size() - 2 <= (b.size() - 2) / 2 && c.size() -2<= (a.size() - 2) / 2 && c.size() -2<= (d.size() - 2) / 2) twicelow = 'C';
    if (d.size() - 2 <= (a.size() - 2) / 2 && d.size() -2<= (b.size() - 2) / 2 && d.size() -2<= (c.size() - 2) / 2) twicelow = 'D';
    cout << twicelow << endl;
    cout << twiceupper << endl;
    if (twiceupper != '0' && twicelow != '0') cout << "C" << endl;
    else if (twicelow != '0') cout << twicelow << endl;
    else if (twiceupper != '0') cout << twiceupper << endl;
    else cout << "C" << endl;
}

#include<iostream>
#include<string>
#include<vector>
using namespace std;

int  descriptionLength(string str ){
    int len=0;
    for (int i  = 2; i  < str.size() ; i ++)
        ++len;

    return len;
}

bool isShorter (vector<string> input , int lenI , int i){
    int lenJ;
    for (int j = 0; j < 4; j++){
        if(i != j){
            lenJ =  descriptionLength(input[j]);
            if( (lenI*2) > lenJ) return false;
        }
    }
    return true;

}

bool isLonger (vector<string> input , int lenI ,int i ){
    int lenJ;
    for (int j = 0; j < 4; j++){
        if(i !=j){
            lenJ =  descriptionLength(input[j]);

            if( lenI < (lenJ*2) ) return false;
        }
    }
    return true;
}

void print(int i){
    if(i == 0) cout<<"A"<<endl;
    else if(i == 1) cout<<"B"<<endl;
    else if(i == 2) cout<<"C"<<endl;
    else if(i == 3) cout<<"D"<<endl;
}
int main(){

    vector<string> input(4);
    for (int i = 0; i < 4; i++)
        cin>>input[i];
    int x = 0;
    int  f;
    for (int i = 0; i < 4; i++)
    {
        if(isShorter(input,descriptionLength(input[i]),i) || isLonger(input,descriptionLength(input[i]),i)){
            f=i;
            x ++;
            break;
        }
    }
    if(x == 1) print(f);
    else    cout<<"C"<<endl;

    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
//#pragma comment(linker, "/STACK:100000000")
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <stdio.h>
#include <vector>
#include <map>

#define ull unsigned ll
#define ll long long
#define ld long double
#define FOR(i, a, b) for(int i=(int)(a); i<(int)(b); ++i)
#define FORN(i, b) for(int i=0; i<(int) (b); i++)
#define FORZ(i, a, b) for (int i=(int)(a); i>(int)(b); --i)
#define mp make_pair
#define fs first
#define sc second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vii vector<int>
#define vll vector<ll>
#define pb push_back
#define ppb pop_back
#define bg begin()
#define ed end()
#define sz size()
#define rsz resize
#define all(a) (a).bg, (a).ed
#define len length()
#define ext return 0;
#define pi 3.1415
ll gcd(ll a, ll b) { if (a == 0 || b == 0) return (a + b); if (a > b) return (gcd(a%b, b)); return (gcd(a, b % a)); }

#define Nmax 100009
#define INF 1000000007
#define y1 yy1
#define eps 1e-5
void out() { std::cout << "NO\n"; exit(0); }
using namespace std;

int ans=-1;
int a[100];

bool calc(int i){
bool is=true;
FOR(j, 0, 4)
 if (i!=j && (!(a[i]/2.0>=a[j])))  is=false;

 if (is) return 1;
 is=true;
 FOR(j, 0, 4)
 if (i!=j && (!(a[i]<a[j]/2)))  is=false;
 return is;
}

int main(){
	ios::sync_with_stdio(0);

    FOR(i, 0, 4) {
     char c[100000];
     gets(c);
     a[i]=strlen(c)-2;
     //cout << a[i] << endl;
    }
    FOR(i, 0, 4) {
    bool is=true;
    is=calc(i);
    if (is && ans>=0) {
        //cout << ans << endl;
        cout << "C" << endl;
        ext;
    } else
    if (is && ans==-1) ans=i;
    }
    char p='C';
    if (ans==1) p='B';
    if (ans==0) p='A';
    if (ans==3) p='D';
    cout << p << endl;

	ext;
}

#include <bits/stdc++.h>
#include <fstream>
#include <cstdio>
using namespace std;
// vector<pair<int,int> > v;
// cin.ignore();//twice getline(cin,s);
// g++ iterator.cpp -std=c++17
// cout<<(A + B == C ? "YES" : "NO")<<endl;
// __gcd(a,b)
// string s=to_string(n);
// string p=s.substr(0,len);
// sort(arr, arr+n, greater<int>());
// cout<<fixed<<setprecision(9)<<pi<<endl
// const  double pi = acos(-1.0);
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define vll vector<ll>
#define mll map<ll,ll >
#define mlli map<ll,ll>::iterator
#define size size()
#define endl "\n"
#define ll long long int
#define ld long double
void fast(){ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);}

int main(void)
{
	fast();
	vector<string> v1(4);
	vector<int> v2(4,0);
	int mini = INT_MAX;
	int maxi = INT_MIN;
	int m1;
	int m2;
	string s = "ABCD";
	for(int i=0;i<4;i++)
	{
		cin>>v1[i];
		v2[i] = v1[i].size-2;
		if(v2[i]>maxi)
		{
			maxi = v2[i];
			m1 = i;
		}
		if(mini>v2[i])
		{
			mini = v2[i];
			m2 = i;
		}
	}

	sort(v2.begin(),v2.end());

	if(maxi>=2*v2[2])
	{
		cout<<s[m1]<<endl;
		return 0;
	}
	if(mini<=v2[1]/2)
	{
		cout<<s[m2]<<endl;
		return 0;
	}
	cout<<s[2]<<endl;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    string a,b,c,d;
        getline(cin,a);
        getline(cin,b);
        getline(cin,c);
        getline(cin,d);

    int x=a.length()-2,y=b.length()-2,z=c.length()-2,w=d.length()-2,mi,ma;
    mi=min(min(x,y),min(w,z));
    ma=max(max(x,y),max(w,z));

    if((mi==x && (2*mi)<=min(w,min(y,z))) ||(ma==x) && ma>=(2*max(max(y,z),w))   ){
        cout<<a.substr(0,1)<<endl;
        return 0;

    }else if((mi==y && (2*mi)<=min(w,min(x,z))) ||(ma==y) && ma>=(2*max(max(x,z),w))   ){
        cout<<b.substr(0,1)<<endl;
        return 0;

    }else if((mi==w && (2*mi)<=min(x,min(y,z))) ||(ma==w) && ma>=(2*max(max(x,z),w))   ){
        cout<<d.substr(0,1)<<endl;
        return 0;

    }else{
        cout<<c.substr(0,1)<<endl;
        return 0;

    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define mod ((ll)1e9+7)
#define inf 0x3f3f3f3f
#define infl 0x3f3f3f3f3f3f3f3f
#define Ninf -0x3e3e3e3f
#define Ninfl -0x3e3e3e3e3e3e3e3f
#define maxx ((ll)1e5+5)
#define endl "\n"

ll exp(ll x,ll y,ll p){ ll res=1; while(y) {if(y%2) res=(res*x%p)%p; x=(x*x)%p; y/=2; } return res;}
ll expm(ll x,ll y){ ll res=1; while(y) {if(y%2) res=(res*x%mod)%mod; x=(x*x)%mod; y/=2; } return res;}
ll add(ll x, ll y) { x += y; if (x >= mod) return x-mod; return x;}
ll sub(ll x, ll y) { x -= y; if (x < 0) return x + mod; return x;}
ll mult(ll x, ll y) { return (x * y) % mod;}
ll rev(ll x) { return expm(x, mod - 2);}
/*
bool sv[maxx]={0};    // returns 0 if a num is prime
int sp[maxx]={0};     // gives smallest prime factor of the number
void Sieve() {for(int i= 2; i< maxx; i+= 2) sv[i]=1,sp[i] = 2;sv[2]=0;for(ll i = 3; i < maxx; i += 2){if (!sv[i]){sp[i] = i;for (ll j = i; (j*i) < maxx; j += 2){if (!sv[j*i])sv[j*i] = true, sp[j*i] = i;}}}}
ll fact[maxx]={0}; // returns factorial of that number
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<maxx;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncrm(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(expm(fact[r],mod-2)))%mod; res=(res*(expm(fact[n-r],mod-2)))%mod; return res;}
ll inv[maxx];   // returns the modular inverse of number
void inversify( ll m){inv[1]=1;for(int i=2;i<maxx;i++){inv[i]= m- m/i*inv[m%i]%m;}}
ll ncr(ll n,ll r,ll m){int ans=1;for (int i = 0; i < r; i++){ans=ans*(n-i)%m*inv[i+1]%m;}return ans;}
*/
void solve(){
  string v[4];
  for(int i=0;i<4;i++)
    cin>>v[i];
  for(int i=0;i<4;i++){
    int curr=0;
    for(int j=0;j<4;j++){
      if(v[i].length()-2>=2*v[j].length()-4)
        curr++;
    }
    if(curr==3)
    {
      cout<<v[i][0];
      return;
    }
    curr=0;
    for(int j=0;j<4;j++){
      if(v[i].length()-2<=2*v[j].length()-4)
        curr++;
    }
    if(curr==3)
    {
      cout<<v[i][0];
      return;
    }
  }
  cout<<"C";
}
signed main(){
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  //int t; cin>>t; while(t--)
  {
    solve();
  }
  return 0;
}

#include<bits/stdc++.h>
typedef long long ll ;
using namespace std ;

int main()
{
    string s[4] ;
    for(int i = 0 ; i < 4 ; i++)
        cin >> s[i] ;
    for(int i = 0 ; i < 4 ; i++)
        for(int j = 0 ; j < 4 ; j++)
        if(s[i].length()<s[j].length())
        swap(s[i] , s[j]);

    if(s[0] == s[3] || s[1] == s[2])
    {
        cout << 'C' <<endl ;
        return 0;
    }

    if((-2+s[0].length())*2<=(-2+s[1].length()))
    {
        cout << s[0][0] <<endl;return 0 ;

    }
      if((-2+s[3].length())/2>=(-2+s[2].length()))
      {
          cout << s[3][0] <<endl ;
          return 0 ;
      }

    cout << 'C' <<endl ;

}

#include <iostream>
using namespace std;

char c, s[101];
int i, j, a[5], h, n,x,y,k;

int main()
{
	for (i = 1; i <= 4; i++)
	{
		cin >> s;
		a[i] = strlen(s);

	}
	for (i = 1; i <= 4; i++)
	{
		k = 0;
		h = 0;
		for (j = 1; j <= 4; j++)
		{
			if ((a[i] > a[j] * 2) && (i != j)) k++;
			if ((a[i] * 2 < a[j]) && (i != j)) k++;
		}
		if (k == 3) x = i;
		if (h == 3) y = j;
	}

	if ((x > 0) && (y > 0)) cout << "C";
	else if (x > 0)
		switch (x)
		{
		case 1: cout << 'A';
			break;
		case 2: cout << 'B';
			break;
		case 3: cout << 'C';
			break;
		case 4: cout << 'D';
			break;
		}
	else
		switch (y)
	{
		case 1: cout << 'A';
			break;
		case 2: cout << 'B';
			break;
		case 3: cout << 'C';
			break;
		case 4: cout << 'D';
			break;
	}

}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    string s,ts1,ts2,ans;
    int len[4],m=100,n=0;
    for(int j=0;j<4;++j)
    {
        s.clear();
        getline(cin,s);
        len[j]=s.size()-2;
        if(len[j]<m)
        {
            m=len[j];
            ts1=s;
        }
        if(len[j]>n)
        {
            n=len[j];
            ts2=s;
        }
    }

    bool f=0,ff=0,cnt=0,cnt2=0;
    for(int j=0;j<4;++j)
    {
        if(len[j]!=m)
        {
            int temp=len[j]/2;
            if(temp>=m && temp!=1)
                f=1;
            else if(temp<m)
            {
                f=0;
                break;
            }
            else
                f=0;
        }
        else if(len[j]==m && cnt==1)
        {
            f=0;
            break;
        }
        else if(len[j]==m && cnt==0)
            cnt=1;
    }
    if(f==0)
    {
        for(int j=0;j<4;++j)
        {
            if(len[j]!=n)
            {
                int temp=len[j]*2;
                if(n>=temp)
                    ff=1;
                else if(n<temp)
                {
                    ff=0;
                    break;
                }
            }
            else if(len[j]==n && cnt2==1)
            {
                ff=0;
                break;
            }
            else if(len[j]==n && cnt2==0)
                cnt2=1;
        }
    }
     if(f==1)
    {
        for(int j=0;j<4;++j)
        {
            if(len[j]!=n)
            {
                int temp=len[j]*2;
                if(n>=temp)
                    ff=1;
                else if(n<temp)
                {
                    ff=0;
                    break;
                }
            }
            else if(len[j]==n && cnt2==1)
            {
                ff=0;
                break;
            }
            else if(len[j]==n && cnt2==0)
                cnt2=1;
        }
    }
    cout << f << " " << ff << endl;
    if(f==1)
        cout << ts1[0] << endl;
    else if(ff==1)
        cout << ts2[0] << endl;
    else if(f==1 && ff==1)
        cout << "C" << endl;
    else
        cout << "C" << endl;
}

#include <cstdio>
#include <cstring>

int main()
{
    int len1, len2, len3, len4;
    char in[ 110 ], res;
    gets( in ); len1 = strlen( in ) - 2;
    gets( in ); len2 = strlen( in ) - 2;
    gets( in ); len3 = strlen( in ) - 2;
    gets( in ); len4 = strlen( in ) - 2;

    bool mark = false;

    if(len1 >= len2 << 1 && len1 >= len3 << 1 && len1 >= len4 << 1)
    {
        puts("A"); return 0;
    }
    if(len2 >= len1 << 1 && len2 >= len3 << 1 && len2 >= len4 << 1)
    {
        puts("B"); return 0;
    }
    if(len4 >= len1 << 1 && len4 >= len2 << 1 && len4 >= len3 << 1)
    {
        puts("D"); return 0;
    }

    if(len1 << 1 <= len2 && len1 << 1 <= len3 && len1 << 1 <= len4)
    {
        puts("A"); return 0;
    }
    if(len2 << 1 <= len1 && len2 << 1 <= len3 && len2 << 1 <= len4)
    {
        puts("B"); return 0;
    }
    if(len4 << 1 <= len1 && len4 << 1 <= len2 && len4 << 1 <= len3)
    {
        puts("D"); return 0;
    }

    puts("C");

    return 0;
}

#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main()
{
    char answers[4] = { 'A', 'B', 'C', 'D' };
    vector<string> answerdescription;
    vector<int> biggeranswers, smalleranswers;
    char input;
    string desc;
    for (int i = 0; i < 4; i++)
    {
        cin >> input >> input >> desc;
        answerdescription.push_back(desc);
    }
    for (int i = 0; i < 4; i++)
    {
        int smaller = 0;
        int bigger = 0;
        for (int j = 0; j < 4; j++)
        {
            if (i != j)
            {
                if (answerdescription[i].length() >= answerdescription[j].length() * 2)
                    bigger++;
                if (answerdescription[i].length() <= (answerdescription[j].length() + 1) / 2)
                    smaller++;
            }
        }
        if (bigger == 3)
            biggeranswers.push_back(i);
        if (smaller == 3)
            smalleranswers.push_back(i);
    }
    if (biggeranswers.size() == 1)
        cout << answers[*biggeranswers.begin()];
    else if (smalleranswers.size() == 1)
        cout << answers[*smalleranswers.begin()];
    else
        cout << answers[2];
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int main(){
	string a,b,c,d;
	cin>>a>>b>>c>>d;
	int l[4],flag=0,ans=2;
	l[0] = a.size()-2;
	l[1] = b.size()-2;
	l[2] = c.size()-2;
	l[3] = d.size()-2;
	int x=0,y=0,max = l[0],min = l[0];
	for(int i=0;i<4;i++){
        int x=0,y=0;
        for(int j=0;j<4;j++){
            if(i!=j){
                if(l[i]*2<=l[j]) x++;
                if(l[i]>=l[j]*2) y++;
            }
        }
        if(x==3||y==3)
        {
            flag=1;
            ans = i;
        }

    }
    if(flag==1) cout<<char(ans+65);
    else cout<<"C\n";
	return 0;
}

#include <bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
    string s;
    int ma=-200;
    int mi=200;
    vector< pair<int,char> >f;
    bool z=false;
    for(int i=0;i<4;i++)
    {
        cin>>s;
        f.push_back({s.size()-2,s[0]});
    }
    if(z==true)
    {
        cout<<'C'<<endl;
        return 0;
    }
    vector<char>ans;
    sort(f.begin(),f.end());
        if(f[0].first!=f[1].first)
        {
            if(f[0].first*2<=f[1].first)
            {
               ans.push_back(f[0].second);
               return 0;
            }
        }

        if(f[f.size()-1].first!=f[f.size()-2].first)
        {
            if(f[f.size()-1].first>=f[f.size()-2].first*2)
            {
                ans.push_back(f[f.size()-1].second);
                return 0;
            }
        }
if(ans.size()==1)cout<<ans[0];
else
cout<<'C'<<endl;
    return 0;
}

#include <iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;

int main()
{
   string a,b,c,d;
   cin>>a>>b>>c>>d;
   unsigned int lAs,lAl,lBs,lBl,lCs,lCl,lDs,lDl;
   lAs=a.size()-3;
   lBs=b.size()-3;
   lCs=c.size()-3;
   lDs=d.size()-3;
   lAl=(a.size()-3)*2;
   lBl=(b.size()-3)*2;
   lCl=(c.size()-3)*2;
   lDl=(d.size()-3)*2;
   if( (lAs<(lBs/2) && lAs<(lCs/2) && lAs<(lDs/2)) || (lAs>lBl && lAs>lCl && lAs>lDl) ){
    cout<<'A';
   }
   else if( (lBs<(lAs/2) && lBs<(lCs/2) && lBs<(lDs/2)) || (lBs>lAl && lBs>lCl && lBs>lDl) ){
    cout<<'B';
   }
   else if( (lCs<(lBs/2) && lCs<(lAs/2) && lCs<(lDs/2)) || (lCs>lBl && lCs>lAl && lCs>lDl) ){
    cout<<'C';
   }
   else if( (lDs<(lBs/2) && lDs<(lCs/2) && lDs<(lAs/2)) || (lDs>lBl && lDs>lCl && lDs>lAl) ){
    cout<<'D';
   }
   else{
    cout<<'C';
   }
   return 0;
}

#include <cstdio>
#include <iostream>

using namespace std;

int main()
{
    #ifndef ONLINE_JUDGE
        freopen ("input.txt","r",stdin);
        //freopen ("output.txt","w",stdout);
    #endif

    char s[4][105]={0};
    cin >> s[0] >> s[1] >> s[2] >> s[3];
    int ans[4]={0};
    for(int i=0;i<4;i++){
        ans[i] = strlen(s[i]);
        ans[i]-=2;
    }
    bool flag[4]={false};
    bool flag_max[4]={false};
    int which=-1;
    for(int j=0;j<4;j++){
    for(int i=0;i<4;i++){
        if(i!=j)
        if(ans[i]/ans[j]>=2) which=j;
        else {which=-1;break;}
    }
    if(which!=-1) break;
    }

    if(which==-1)
    for(int j=0;j<4;j++){
    for(int i=0;i<4;i++){
        if(i!=j)
        if(ans[j]/ans[i]>=2) which=j;
        else {which=-1;break;}
    }
    if(which!=-1) break;
    }
    if(which==0) {cout<< "A"; return 0;}
    if(which==1) {cout<< "B"; return 0;}
    if(which==2) {cout<< "C"; return 0;}
    if(which==3) {cout<< "D"; return 0;}
    cout << "C";
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
    char a[100],b[100],c[100],d[100];
    int k,l,m,n,A,B,C,D,s[100];
    scanf("%s%s%s%s",a,b,c,d);
    s[0]=strlen(a)-2;
    s[1]=strlen(b)-2;
    s[2]=strlen(c)-2;
    s[3]=strlen(d)-2;
    A=s[0];
    B=s[1];
    C=s[2];
    D=s[3];
    sort(s,s+4);
    if(s[0]*2<=s[1])
        m=s[0];
    else if(s[2]*2<=s[3])
        m=s[3];
    else{
        cout<<"C"<<endl;
        return 0;
    }
    if(m==A){
        cout<<"A"<<endl;
        return 0;
    }
    else if(m==B){
        cout<<"B"<<endl;
        return 0;
    }
    else if(m==C){
        cout<<"C"<<endl;
        return 0;
    }
    else if(m==D){
        cout<<"D"<<endl;
        return 0;
    }
}

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
using namespace std;

int main()
{
    char a[100],b[100],c[100],d[100],result;
    int counter=0,big=0,sa[5];
    for(char i='A';i<='D';i++)
    {
        cout << i << ". ";
        if(i=='A')
            cin >> a;
        else if(i=='B')
            cin >> b;
        else if(i=='C')
            cin >> c;
        else
            cin >> d;
    }
    sa[0]=strlen(a);
    sa[1]=strlen(b);
    sa[2]=strlen(c);
    sa[3]=strlen(d);
    int k=0,flag1=1,flag2=1;
    while(k<=3)
    {
        flag1=1;
        flag2=1;
        for(int i=0;i<=3;i++)
    {
        if(sa[k]<=(sa[i]/2))
        {
            flag1++;
        }
        else if(sa[k]>=(sa[i]*2))
        {
            flag2++;
        }
    }
    if(flag1==4 || flag2==4)
        {
            counter++;
            result=65+k;
        }
        k++;
    }
    if(counter>1 || counter == 0)
    {
        cout << "C";
    }
    else
        cout << result;

    return 0;
}

#include<bits/stdc++.h>

typedef long long ll;

using namespace std;

int main()
{
   // freopen ("in.txt","r",stdin);
    string a,b,c,d;
    cin>>a;
    cin>>b;
    cin>>c;
    cin>>d;
    int arr[5];

    int a_len = a.length()-2;
    int b_len = b.length()-2;
    int c_len = c.length()-2;
    int d_len = d.length()-2;
    arr[0] = a_len;
    arr[1] = b_len;
    arr[2] = c_len;
    arr[3] = d_len;
    //printf("%d  %d  %d  %d\n",a_len,b_len,c_len,d_len);
    int index = -2,index2 = -2;
    int min_val = INT_MAX,max_val = INT_MIN;

    for(int i = 0; i < 4; i++)
    {
        if(min_val > arr[i])
        {
            min_val = arr[i];
            index = i;
        }
        if(max_val < arr[i])
        {
            max_val = arr[i];
            index2 = i;
        }
    }
    //got the min value and max val

    //checking for min value
    int flag = 0,ans;
    //cout<<"index = "<<index<<" index2 = "<<index2<<endl;
    if(index == 0)
    {
        if(min_val <= (arr[3]/2) && min_val <= (arr[1]/2) && min_val <= (arr[2]/2))
        {
            flag = 1;
            ans = 0;
        }
    }

    else if(index == 1)
    {
        if(min_val <= (arr[0]/2) && min_val <= (arr[3]/2) && min_val <= (arr[2]/2))
        {
            flag = 1;
            ans = 1;
        }
    }
    else if(index == 2)
    {
        if(min_val <= (arr[0]/2) && min_val <= (arr[1]/2) && min_val <= (arr[3]/2))
        {
            flag = 1;
            ans = 2;
        }
    }

    else if(index == 3)
    {
       // printf("min_val = %d\n",min_val);
        //printf("here bitch\n");
        if(min_val <= (arr[0]/2) && min_val <= (arr[1]/2) && min_val <= (arr[2]/2))
        {
            flag = 1;
            ans = 3;
        }
    }

    int flag2 = 0;
    //going for max

       if(index2 == 0)
     {
        if(max_val >= 2*(arr[2]) && max_val >= 2*(arr[1]) && max_val >= 2*(arr[3]))
        {
            flag2 = 1;
            ans = 0;
        }
     }

    else if(index2 == 1)
    {
        if(max_val >= 2*(arr[2]) && max_val >= 2*(arr[0]) && max_val >= 2*(arr[3]))
        {
            flag2 = 1;
            ans = 1;
        }
    }
    else if(index2 == 2)
    {
        if(max_val >= 2*(arr[0]) && max_val >= 2*(arr[1]) && max_val >= 2*(arr[3]))
        {
            flag2 = 1;
            ans = 2;
        }
    }
    else if(index2 == 3)

    {
        if(max_val >= 2*(arr[2]) && max_val >= 2*(arr[1]) && max_val >= 2*(arr[0]))
        {
            flag2 = 1;
            ans = 3;
        }
    }

   //printf("ans = %d after max\n",ans);
if(flag == 0 || flag2 == 0 || (flag == 1 && flag2 == 1))
    cout<<"C"<<endl;
else
{
    if(ans == 0)
        cout<<"A"<<endl;

    else if(ans == 1)
        cout<<"B"<<endl;

    else if(ans == 2)
        cout<<"C"<<endl;

    else
        cout<<"D"<<endl;
}

	return 0;

}

#include <bits/stdc++.h>

using namespace std;

#define pb(a)                   push_back(a)
#define all(v)                  v.begin(), v.end()
#define SORT(v)                 sort(v.begin(), v.end())
#define TORS(v)                 sort(v.begin(), v.end(), greater<int>())
#define FOR(type, a, b)         for(type i = type(a); i <= type(b); i++)
#define ROF(type, b, a)         for(type i = type(b); i >= type(a); i--)
#define READ()                  freopen("in.txt", "r", stdin);
#define WRITE()                 freopen("out.txt", "w", stdout);
#define fastIO()                ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

typedef long long               ll;
typedef unsigned long long      ull;
typedef vector<int>             vi;
typedef vector<ll>              vll;
typedef pair<int, char>         pic;
typedef vector<pic>             vic;
typedef set<int>                si;
typedef map<string, int>        msi;

int main(){
    fastIO();
    //READ();

    vic test;
    FOR(int, 1, 4){
        pic pest;
        string a; cin >> a;
        pest.first = a.size() - 2;
        pest.second = a[0];
        test.pb(pest);
    }
    SORT(test);

    int i = 1, cnt = 0;
    char res;
    while(i < 4){
        if(test[i - 1].first * 2 <= test[i].first){
            res = test[i - 1].second;
            cnt++;
        }
        i++;
    }

    if(cnt == 1) cout << res << endl;
    else cout << "C" << endl;
    return 0;
}

#include<cstdio>
#include<cstdlib>
#include<cstring>
int main()
{
	char a[102],b[102],c[102],d[102];
	scanf("%s",a);
	scanf("%s",b);
	scanf("%s",c);
	scanf("%s",d);
	int a1[5];a1[0]=strlen(&a[2]);
	a1[1]=strlen(&b[2]);
	a1[2]=strlen(&c[2]);
	a1[3]=strlen(&d[2]);
	int i,j,mc=1,count=1,min=a1[0],max=a1[0];
	char in1='A',in2='A';
	for(i=1;i<4;i++)
	{
	//printf("ii %d %d %d %d\n",count,mc,min,max,a1[i]);
		if(max*2<=a1[i]&&max<a1[i])
		{
			max=a1[i];
			in1=in1+i;
			count=1;
		}
		else if(max==a1[i])
			count++;
		else if((max*2>a1[i]&&max<a1[i])||(max>a1[i]&&max<2*a1[i]))
		{
			count=-100;
		}
		if(min>=2*a1[i]&&min>a1[i])
		{
			min=a1[i];
			in2=in2+i;
			mc=1;
		}
		else if(min==a1[i])
			mc++;
		else if((min<2*a1[i]&&min>a1[i])||(min<a1[i]&&a1[i]<2*min))
		{
			mc=-100;
		}
	}
	//printf("%d %d\n",count,mc);
	if(count==1)
		printf("%c\n",in1);
	else
	if(mc==1)
		printf("%c\n",in2);
	else
		printf("C\n");
	return 0;
}

#include <iostream>
#include <string>
using namespace std;

string a,b,c,d;
int ar[5];
char aw[4] = {'A','B','C','D'};
int j,k,Max,Min;

int main()
{
    while(cin >> a >> b >> c >> d)
    {
        j = 0,k = 0,Max = 0,Min = 0;
         int p = a.length();
         int q = b.length();
         int r = c.length();
         int s = d.length();
         if(p*2 < q && p*2 < r && p*2 < s )
            cout << "A" << endl;
         else if(q*2 < p && q*2 < r && q*2 < s )
            cout << "B" << endl;
         else if(r*2 < p && r*2 < q && r*2 < s )
            cout << "C" << endl;
         else if(s*2 < p && s*2 < q && s*2 < r )
            cout << "D"<< endl;
        else if(p > 2*q && p > 2*r && p > 2*s )
            cout << "A" << endl;
         else if(q > p*2 && q > 2*r && q > 2*s)
            cout << "B" << endl;
         else if(r > 2*q && r > 2*p && r > 2*s)
            cout << "C" << endl;
         else if(s > 2*q && s > 2*p && s > 2*r)
            cout << "D" << endl;
         else
            cout << "C" << endl;
    }
    return 0;
}

#include <iostream>
#include <map>
#include <string>
using namespace std;

string s;

int main(){

    int ma = 0, mi = 0, arr[4], i = 0, p1 = 0, p2 = -1, c = 0;
    bool y = false;
    for(int j = 0; j < 4; j++)
    {
        cin >> s;
        i = s.length()-2;
        arr[j] = i;
        //cout << i << endl;
    }

    for(i = 0; i < 4; i++){
        p1 = 0;
        for(int j = 0; j < 4; j++){

            if(j==i)
                continue;
            if(arr[i]*2<=arr[j])
                p1++;
        }
        if(p1==3)
        {
            p2 = i;
            c++;
            y = true;
        }
    }
    for(i = 0; i < 4; i++){
        p1 = 0;
        for(int j = 0; j < 4; j++){

            if(j==i)
                continue;
            if((arr[i]/2)>=arr[j])
                p1++;
        }
        if(p1==3)
        {
            mi = i;
            ma++;
            y = true;
        }
    }
    if(!mi && p2 && c == 1)
    {
        if(p2==0)
            cout << "A" << endl;
        if(p2==1)
            cout << "B" << endl;

        if(p2==2)
            cout << "C" << endl;

        if(p2==3)
            cout << "D" << endl;
        return 0;

    }
    if(mi && !p2 && ma == 1)
    {
        if(mi==0)
            cout << "A" << endl;
        if(mi==1)
            cout << "B" << endl;

        if(mi==2)
            cout << "C" << endl;

        if(mi==3)
            cout << "D" << endl;
        return 0;

    }
    cout << "C" << endl;
    return 0;
}