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?


-----Input-----

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 "_". 


-----Output-----

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


-----Examples-----
Input
A.VFleaKing_is_the_author_of_this_problem
B.Picks_is_the_author_of_this_problem
C.Picking_is_the_author_of_this_problem
D.Ftiasch_is_cute

Output
D

Input
A.ab
B.abcde
C.ab
D.abc

Output
C

Input
A.c
B.cc
C.c
D.c

Output
B



-----Note-----

In 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.

Difficulty: interview

Starter code:

Solutions:
"""
Codeforces Round 250 Div 2 Problem A

Author  : chaotic_iak
Language: Python 3.3.4
"""

class IOHandlerObject(object):
    def getInput(self, mode=2):
        # 0: String
        # 1: List of strings
        # 2: List of integers
        inputs = input().strip()
        if mode == 0:
            return inputs
        if mode == 1:
            return inputs.split()
        if mode == 2:
            return [int(x) for x in inputs.split()]

    def writeOutput(self, s="\n"):
        if isinstance(s, list): s = " ".join(s)
        print(s)

IOHandler = IOHandlerObject()
g = IOHandler.getInput
w = IOHandler.writeOutput

############################## SOLUTION ##############################
a,b,c,d = g(0),g(0),g(0),g(0)
r = [(len(a)-2,0), (len(b)-2,1), (len(c)-2,2), (len(d)-2,3)]
r.sort()
t = -1
if r[0][0]*2 <= r[1][0]: t = r[0][1]
if r[3][0] >= r[2][0] * 2:
    if not t+1:
        t = r[3][1]
    else:
        t = 5

if t == -1 or t == 5:
    print("C")
else:
    print(chr(65+t))

a = []
for i in range(4):
    x = input().strip()[2:]
    a.append(len(x))
good = []
for i in range(4):
    fl = True
    for j in range(4):
        if j != i and a[i] / a[j] < 2:
            fl = False
    if fl:
        good.append(i)
    else:
        fl = True
        for j in range(4):
                if j != i and a[j] / a[i] < 2:
                    fl = False 
        if fl:
            good.append(i)
if len(good) == 1:
    print(chr(ord('A') + good[0]))
else:
    print('C')

s = []
length = [0] * 4
for i in range(4):
    s.append(input().rstrip())
    s[i] = s[i][2:]
    length[i] = len(s[i])
var = []
for i in range(4):
    if length[i] >= 2 * max(length[:i] + length[i + 1:]) or length[i] <= min(length[:i] + length[i + 1:]) // 2:
        var.append(i)
if len(var) == 1:
    print(chr(ord('A') + var[0]))
else:
    print("C")



a = [len(input()) - 2 for i in range(4)]
cnt = 0
res = 2
for i in range(4):
    flag1 = True
    flag2 = True
    for j in range(4):
        if j != i:
            if a[i] < a[j] * 2:
                flag1 = False
            if a[i] * 2 > a[j]:
                flag2 = False
    if flag1 or flag2:
        cnt += 1
        res = i
if cnt == 1:
    print(["A", "B", "C", "D"][res])
else:
    print("C")

def main():
    s = "ABCD"
    arr = [len(input()) - 2 for i in range(4)]

    decides = []
    Min = min(arr)
    tmp = arr[:]; tmp.remove(Min)
    if Min * 2 <= min(tmp):
        decides.append(s[arr.index(Min)])
    
    Max = max(arr)
    tmp = arr[:]; tmp.remove(Max)
    if Max >= max(tmp) * 2:
        decides.append(s[arr.index(Max)])
    
    if len(decides) == 1:
        print(decides[0])
    else:
        print("C")

main()


def prov(la, lb, lc, ld):
    if la/lb >= 2 and la/lc >= 2 and la/ld >= 2:
        return True
    return False
def prov1(la, lb, lc, ld):
    if  lb/la >= 2 and lc/la >= 2 and ld/la >= 2:
        return True
    return False
a = list(input())
b = list(input())
c = list(input())
d = list(input())
a = a[2:]
b = b[2:]
c = c[2:]
d = d[2:]
la = len(a)
lb = len(b)
lc = len(c)
ld = len(d)
q = []
if prov(la, lb, lc, ld) or prov1(la, lb, lc, ld):
    q.append('A')
if prov(lb, la, lc, ld) or prov1(lb, la, lc, ld):
    q.append('B')
if prov(lc, la, lb, ld) or prov1(lc, ld, la, lb):
    q.append('C')
if prov(ld, la, lb, lc) or prov1(ld, la, lb, lc):
    q.append('D')
if len(q) == 1:
    print(q[0])
else:
    print('C')

import sys
a = len(input()) - 2
b = len(input()) - 2
c = len(input()) - 2
d = len(input()) - 2
x = [0, 0, 0, 0]
if (a >= 2 * b and a >= 2 * c and a >= 2 * d )or (2 * a <= b and 2 * a <=  c and 2 * a <=  d):
    x[0] = 1
if (b >= 2 * a and b >= 2 * c and b >= 2 * d )or (2 * b <=a and 2 * b <=  c and 2 * b <=  d):
    x[1] = 1
if (c >= 2 * b and c >= 2 * a and c >= 2 * d )or (2 * c <= a and 2 * c <= b and 2 * c <=  d):
    x[2] = 1
if (d >= 2 * b and d >= 2 * c and d >= 2 * a )or (2 * d <= b and 2 * d <=  c and 2 * d <= a):
    x[3] = 1

if sum(x) == 1:
    if x[0] == 1:
        print('A')
    if x[1] == 1:
        print('B')
    if x[2] == 1:
        print('C')
    if x[3] == 1:
        print('D')
else:
    print('C')
    



#! /usr/bin/env python

a = len(input()[2:])
b = len(input()[2:])
c = len(input()[2:])
d = len(input()[2:])

arr = [a, b, c, d]

candi = []
for i, x in enumerate(arr):
    sf = True
    bf = True
    for j, y in enumerate(arr):
        if i != j:
            if x > y / 2:
                sf = False
            if x < y * 2:
                bf = False
    if sf or bf:
        candi.append(i)

if len(candi) == 1:
    print(chr(ord('A') + candi[0]))
else:
    print("C")


answerlist=[]
lengthlist=[]
great=0
finallist=['A','B','C','D']
for i in range(4):
    answerlist.append(str(input()))
    lengthlist.append(len(answerlist[i])-2)

lengthlist1=lengthlist[:]
lengthlist.sort()

if lengthlist[0]*2<=lengthlist[1]:
    great=1
if lengthlist[3]>=lengthlist[2]*2:
    if great==1:
        great=0
    else:
        great=2
if great==0:
    print('C')
if great==1:
    print(finallist[lengthlist1.index(lengthlist[0])])
if great==2:
    print(finallist[lengthlist1.index(lengthlist[3])])

variants = [len(input()[2:]) for i in range(4)]
is_awesome = [1]*4
for i in range(4):
    for j in range(4):
        if i != j and (not variants[i] * 2 <= variants[j]):
            is_awesome[i] = 0
    if not is_awesome[i]:
        is_awesome[i] = 1
        for j in range(4):
            if i != j and (not variants[i] / 2 >= variants[j]):
                is_awesome[i] = 0
if sum(is_awesome) == 1:
    print(chr(ord('A') + is_awesome.index(1)))
else:
    print("C")


varianti=[input()[2:] for i in range(4)]
lenz=[len(varianti[i]) for i in range(4)]
counter=0
for i in range(4):
    dub=lenz[:]
    now=dub.pop(i)
    c1=0
    c2=0
    for z in range(3):
        if(now/dub[z]>=2):
            c1+=1
        elif (dub[z]/now>=2):
            c2+=1
    if c1==3 or c2==3 :
        zamechat=i
        counter+=1
if counter==1:
    print(['A','B','C','D'][zamechat])
else:
    print('C')


import sys
#sys.stdin = open('input.txt', 'r')
t, a = input().split('.')
t, b = input().split('.')
t, c = input().split('.')
t, d = input().split('.')
k = [0]*4
if 2*len(a) <= len(b) and 2*len(a) <= len(c) and 2*len(a) <= len(d): k[0]=1
if 2*len(b) <= len(a) and 2*len(b) <= len(c) and 2*len(b) <= len(d): k[1]=1
if 2*len(c) <= len(a) and 2*len(c) <= len(b) and 2*len(c) <= len(d): k[2]=1
if 2*len(d) <= len(a) and 2*len(d) <= len(b) and 2*len(d) <= len(c): k[3]=1
s = [0]*4
if 2*len(b) <= len(a) and 2*len(c) <= len(a) and 2*len(d) <= len(a): s[0]=1
if 2*len(a) <= len(b) and 2*len(c) <= len(b) and 2*len(d) <= len(b): s[1]=1
if 2*len(a) <= len(c) and 2*len(b) <= len(c) and 2*len(d) <= len(c): s[2]=1
if 2*len(a) <= len(d) and 2*len(b) <= len(d) and 2*len(c) <= len(d): s[3]=1
if sum(k) + sum(s) == 1:
	if k[0] == 1: print('A')
	if k[1] == 1: print('B')
	if k[2] == 1: print('C')
	if k[3] == 1: print('D')
	if s[0] == 1: print('A')
	if s[1] == 1: print('B')
	if s[2] == 1: print('C')
	if s[3] == 1: print('D')
else:
	print('C')









a = input()
b = input()
c = input()
d = input()

eles = [a, b , c , d]
elems = [a[2:], b[2:], c[2:], d[2:]]
#print(elems)
g = []
l = [len(elems[0]),len(elems[1]), len(elems[2]), len(elems[3])]
#print(l)
for i in range(4):
    ele = l[i]
    r = []
    for j in range(4):
        
        if i == j :
            continue
        else:
            ratio = ele / l[j]
            #print(ratio)
            r.append(ratio)
    #print(r)
    count = 0
    for k in range(len(r)):
        if r[k] <= 0.5  :
            count += 1
    if count == 3 :
        g.append(i)
    else:
        count1 = 0
        for c in range(len(r)):
            if r[c] >= 2:
                count1 += 1
        if count1 == 3:
            g.append(i)
            
    

if len(g) == 1:
    print(eles[g[0]][0])
else:
    print('C')


a = [0] * 4
for i in range(4):
    s = input().strip()
    a[i] = len(s) - 2
ans = 'C'
f = 0
for i in range(4):
    f1 = 1
    f2 = 1
    for j in range(4):
        if i != j and a[i] < 2 * a[j]:
            f1 = 0
        if  i != j and 2 * a[i] > a[j]:
            f2 = 0
    if f1 :
        ans = chr(ord("A") + i)
        f += 1
    if f2:
        ans = chr(ord("A") + i)
        f += 1
if f == 1:
    print(ans)
else:
    print("C")

a = [len(input()[2:]), 'A']
b = [len(input()[2:]), 'B']
c = [len(input()[2:]), 'C']
d = [len(input()[2:]), 'D']
ans = None

l = list(sorted([a, b, c, d]))

if l[0][0] * 2 <= l[1][0] and l[2][0] * 2 > l[3][0]:
    ans = l[0][1]
elif l[2][0] * 2 <= l[3][0] and l[0][0] * 2 > l[1][0]:
    ans = l[3][1]
else:
    ans = 'C'

print(ans)


x, y = {}, {}

def get_len(path):
    return int(len(path[1]))

x['A'] = input()
x['B'] = input()
x['C'] = input()
x['D'] = input()

y = sorted(list(x.items()), key=get_len)

if (len(y[0][1]) - 2) * 2 <= (len(y[1][1]) - 2) and (len(y[3][1]) - 2) < (len(y[2][1]) - 2) * 2:
    print( y[0][0] )
elif (len(y[3][1]) - 2) >= (len(y[2][1]) - 2) * 2 and (len(y[0][1]) - 2) * 2 > (len(y[1][1]) - 2):
    print( y[3][0] )
else:
    print( "C" )


s = []
length = [0 for i in range(4)]
for i in range(4):
    s.append(input()[2:])
    length[i] = len(s[i])

var = []
for i in range(4):
    if length[i] >= 2*max(length[:i] + length[i+1:]) or \
       length[i] <= min(length[:i] + length[i+1:])//2:
        var.append(i)

if len(var) == 1:
    print(chr(ord('A') + var[0]))
else:
    print('C')


q, t = 0, sorted([(len(input()) - 2, i) for i in 'ABCD'])
if 2 * t[0][0] <= t[1][0]: q += 1
if t[3][0] >= 2 * t[2][0]: q += 2
print(['C', t[0][1], t[3][1], 'C'][q])

a=input()[2:]
b=input()[2:]
c=input()[2:]
d=input()[2:]

L=[a,b,c,d]
S="ABCD"
x=0
e=[]
for i in range(4):
    l=True
    s=True
    for j in range(4):
        if(j==i):
            continue
        if(len(L[i])<len(L[j])*2):
            l=False
        if(len(L[j])<len(L[i])*2):
            s=False
    if(l and not s):
        x+=1
        e.append(i)
    elif(s and not l):
        x+=1
        e.append(i)
if(x==1):
    print(S[e[0]])
else:
    print("C")


a = []
a.append(input())
a.append(input())
a.append(input())
a.append(input())
b = []

for i in range(len(a)):
    b.append(len(a[i]) - 2)

b.sort()

res = []

if b[0] * 2 <= b[1] and b[1] != 0:
    res.append(b[0])

if b[2] * 2 <= b[3] and b[3] != 0:
    res.append(b[3])


if len(res) == 1:
    for i in range(len(a)):
        if len(a[i]) - 2 == res[0]:
            print(a[i][:1])
else:
    print('C')

x = []
x.append((len(input())-2, 'A'))
x.append((len(input())-2, 'B'))
x.append((len(input())-2, 'C'))
x.append((len(input())-2, 'D'))

x.sort()

if x[0][0] * 2 <= x[1][0] and x[2][0] * 2 <= x[3][0]:
    print('C')
else:
    if x[0][0] * 2 <= x[1][0]:
        print(x[0][1])
    else:
        if x[2][0] * 2 <= x[3][0]:
            print(x[3][1])
        else:
            print('C')

a = sorted(zip((len(input()) - 2 for i in range(4)), "ABCD"))
if 2 * a[2][0] <= a[3][0] and 2 * a[0][0] > a[1][0]:
  print(a[3][1])
elif 2 * a[2][0] > a[3][0] and 2 * a[0][0] <= a[1][0]:
  print(a[0][1])
else:
  print("C")

answers = ['A', 'B', 'C', 'D']
variants = []
for i in range(0, 4):
    variants.append((len(input()) - 2, answers[i]))
asc = sorted(variants, key=lambda variant: variant[0])
des = sorted(variants, key=lambda variant: variant[0], reverse = True)

good_variants = []
if (2 * asc[0][0] <= asc[1][0]):
    good_variants.append(asc[0])
if (2 * des[1][0] <= des[0][0]):
    good_variants.append(des[0])
print(good_variants[0][1] if len(good_variants) == 1 else 'C')

v = [input()[2:] for i in range(4)]
l = [(len(s),s) for s in v]

min_l, min_s = min(l)[0], min(l)[1]
max_l, max_s = max(l)[0], max(l)[1]

min_ind = 0
max_ind = 0

for i in range(4):
    if i != v.index(min_s) and len(v[i]) / min_l >= 2:
        min_ind += 1
    if i != v.index(max_s) and max_l / len(v[i]) >= 2:
        max_ind += 1

if min_ind == 3 and max_ind != 3:
    print(chr(65 + v.index(min_s)))
elif max_ind == 3 and min_ind != 3:
    print(chr(65 + v.index(max_s)))
else:print('C')

questionNames = ['A', 'B', 'C', 'D']

lengths = [(len(input()) - 2, questionNames[i]) for i in range(4)]
lengths.sort()

firstIsGreat = (lengths[0][0] <= lengths[1][0] // 2)
lastIsGreat = (lengths[3][0] >= lengths[2][0] * 2)

if firstIsGreat ^ lastIsGreat:
	if firstIsGreat:
		print(lengths[0][1])
	else:
		print(lengths[3][1])
else:
	print('C')