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: EASY

Solutions:
(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])


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True
t = []
for i in range(4):
	t.append(input()[2:])
m = sorted(list(map(len, t)))
if m[1] >= 2 * m[0] and m[3] >= 2 * m[2] or (m[1] < 2 * m[0] and m[3] < 2 * m[2]):
	print('C')
elif m[1] >= 2 * m[0]:
	for i in range(4):
		if m[0] == len(t[i]):
			print(chr(ord('A') + i))
			exit()
elif m[3] >= 2 * m[2]:
	for i in range(4):
		if m[3] == len(t[i]):
			print(chr(ord('A') + i))
			exit()


l = [input() for _ in range(4)]
m = list(map(lambda x: len(x[2:]), l))
res = []
for i in l:
	y = 1
	r1 = True
	r2 = True
	for j in l:
		if i != j:
			if len(i[2:]) >= len(j[2:]) * 2 and r1:
				y *= 1
				r2 = False
			elif len(i[2:]) <= len(j[2:]) / 2 and r2:
				r1 = False
				y *= 1
			else:
				y *= 0
				break
	res.append(y)
if res.count(0) == 4:
	print('C')
elif res.count(1) > 1:
	print('C')
else:
	print('ABCD'[res.index(1)])


a = len(input()) - 2
b = len(input()) - 2
c = len(input()) - 2
d = len(input()) - 2
l = list()
l.append(a)
l.append(b)
l.append(c)
l.append(d)
l = sorted(l)
(x, y) = (0, 0)
if l[0] <= l[1] // 2 and l[0] <= l[2] // 2 and (l[0] <= l[3] // 2):
	x = 1
if l[3] >= l[0] * 2 and l[3] >= l[1] * 2 and (l[3] >= l[2] * 2):
	y = 1
if x + y == 1:
	if x == 1:
		if l[0] == c:
			print('C')
		elif l[0] == a:
			print('A')
		elif l[0] == b:
			print('B')
		else:
			print('D')
	if y == 1:
		if l[3] == c:
			print('C')
		elif l[3] == a:
			print('A')
		elif l[3] == b:
			print('B')
		else:
			print('D')
else:
	print('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')


answers = [len(input().split('.')[1]) for x in range(4)]
letters = ['A', 'B', 'C', 'D']
good = []
for x in range(4):
	condition = True
	for y in range(4):
		if x != y and (not answers[x] * 2 <= answers[y]):
			condition = False
			break
	if not condition:
		condition = True
		for y in range(4):
			if x != y and (not answers[x] >= answers[y] * 2):
				condition = False
				break
	if condition:
		good.append(x)
if len(good) != 1:
	print('C')
else:
	print(letters[good[0]])


l = [len(input()) - 2 for _ in range(4)]
res = []
for i in range(4):
	if 2 * l[i] <= min(l[:i] + l[i + 1:]) or l[i] >= 2 * max(l[:i] + l[i + 1:]):
		res.append(i)
print('ABCD'[res[0] if len(res) == 1 else 2])


def func(l):
	x = 0
	k = 2
	for i in range(4):
		p = [int(not 2 * l[i] <= l[j]) for j in range(4) if i != j]
		f = [int(2 * l[j] <= l[i]) for j in range(4) if i != j]
		if p == f and len(list(dict.fromkeys(f))) == 1:
			x += 1
			k = i
	if x == 1:
		return chr(ord('A') + k)
	return 'C'
(a, b, c, d) = (len(input()) - 2, len(input()) - 2, len(input()) - 2, len(input()) - 2)
x = func([a, b, c, d])
print(x)


l = input()
l = len(l) - 2
l2 = input()
l2 = len(l2) - 2
l3 = input()
l3 = len(l3) - 2
l4 = input()
l4 = len(l4) - 2
m = [l, l2, l3, l4]
m.sort()
pp = 0
if m[1] / m[0] >= 2 and m[2] / m[0] >= 2 and (m[3] / m[0] >= 2):
	pp += 1
if m[3] / m[0] >= 2 and m[3] / m[1] >= 2 and (m[3] / m[2] >= 2):
	pp += 1
if pp == 1:
	if m[1] / m[0] >= 2 and m[2] / m[0] >= 2 and (m[3] / m[0] >= 2):
		if m[0] == l:
			print('A')
		elif m[0] == l2:
			print('B')
		elif m[0] == l3:
			print('C')
		else:
			print('D')
	elif m[3] / m[0] >= 2 and m[3] / m[1] >= 2 and (m[3] / m[2] >= 2):
		if m[3] == l:
			print('A')
		elif m[3] == l2:
			print('B')
		elif m[3] == l3:
			print('C')
		else:
			print('D')
	else:
		print('C')
else:
	print('C')


a = input()[2:]
b = input()[2:]
c = input()[2:]
d = input()[2:]
zc = 0
z = -100
if len(a) * 2 <= len(b) and len(a) * 2 <= len(c) and (len(a) * 2 <= len(d)) or (len(a) >= len(b) * 2 and len(a) >= len(c) * 2 and (len(a) >= len(d) * 2)):
	zc += 1
	z = 'A'
if len(b) * 2 <= len(a) and len(b) * 2 <= len(c) and (len(b) * 2 <= len(d)) or (len(b) >= len(a) * 2 and len(b) >= len(c) * 2 and (len(b) >= len(d) * 2)):
	zc += 1
	z = 'B'
if len(c) * 2 <= len(b) and len(c) * 2 <= len(a) and (len(c) * 2 <= len(d)) or (len(c) >= len(b) * 2 and len(c) >= len(a) * 2 and (len(c) >= len(d) * 2)):
	zc += 1
	z = 'C'
if len(d) * 2 <= len(b) and len(d) * 2 <= len(c) and (len(d) * 2 <= len(a)) or (len(d) >= len(b) * 2 and len(d) >= len(c) * 2 and (len(d) >= len(a) * 2)):
	zc += 1
	z = 'D'
if zc == 1:
	print(z)
else:
	print('C')


a = len(input()[2:])
b = len(input()[2:])
c = len(input()[2:])
d = len(input()[2:])
(nice, k) = (0, 'C')
if a >= 2 * b and a >= 2 * c and (a >= 2 * d):
	nice += 1
	k = 'A'
if 2 * a <= b and 2 * a <= c and (2 * a <= d):
	nice += 1
	k = 'A'
if b >= 2 * a and b >= 2 * c and (b >= 2 * d):
	nice += 1
	k = 'B'
if 2 * b <= a and 2 * b <= c and (2 * b <= d):
	nice += 1
	k = 'B'
if c >= 2 * b and c >= 2 * a and (c >= 2 * d):
	nice += 1
	k = 'C'
if 2 * c <= b and 2 * c <= a and (2 * c <= d):
	nice += 1
	k = 'C'
if d >= 2 * b and d >= 2 * c and (d >= 2 * a):
	nice += 1
	k = 'D'
if 2 * d <= b and 2 * d <= c and (2 * d <= a):
	nice += 1
	k = 'D'
if nice == 1:
	print(k)
else:
	print('C')


a = []
for i in range(4):
	a.append(input()[2:])
g = []
for i in range(4):
	flag = 1
	flag1 = 1
	for j in range(4):
		flag = flag and (i == j or len(a[i]) >= 2 * len(a[j]))
		flag1 = flag1 and (i == j or len(a[i]) * 2 <= len(a[j]))
	if flag or flag1:
		g.append(i)
if len(g) == 1:
	print(chr(g[0] + 65))
	exit()
print('C')


s1 = input()
s2 = input()
s3 = input()
s4 = input()
x1 = len(s1) - 2
x2 = len(s2) - 2
x3 = len(s3) - 2
x4 = len(s4) - 2
a = []
a.append((x1, 1))
a.append((x2, 2))
a.append((x3, 3))
a.append((x4, 4))
d = {1: 'A', 2: 'B', 3: 'C', 4: 'D'}
a.sort()
f1 = 0
f2 = 0
if a[0][0] <= a[1][0] // 2 and a[0][0] <= a[2][0] // 2 and (a[0][0] <= a[3][0] // 2):
	f1 = 1
if a[3][0] >= a[0][0] * 2 and a[3][0] >= a[1][0] * 2 and (a[3][0] >= a[2][0] * 2):
	f2 = 1
if f1 == 1 and f2 == 0:
	print(d[a[0][1]])
elif f1 == 0 and f2 == 1:
	print(d[a[3][1]])
else:
	print('C')


from array import array
a = array('i', [x for x in range(0, 4)])
aa = ['' for x in range(0, 4)]
for x in range(0, 4):
	aa[x] = input()
for i in range(0, 4):
	a[i] = len(aa[i]) - 2
(d, c) = (-1, 0)
for i in range(0, 4):
	if a[i] <= a[(i + 1) % 4] / 2 and a[i] <= a[(i + 2) % 4] / 2 and (a[i] <= a[(i + 3) % 4] / 2):
		d = i
		c += 1
	if a[i] >= a[(i + 1) % 4] * 2 and a[i] >= a[(i + 2) % 4] * 2 and (a[i] >= a[(i + 3) % 4] * 2):
		d = i
		c += 1
if c == 1:
	if d == 0:
		print('A')
	elif d == 1:
		print('B')
	elif d == 2:
		print('C')
	else:
		print('D')
else:
	print('C')


i = sorted(enumerate([len(input()) - 2 for _ in range(4)]), key=lambda x: x[1])
(a, b) = (False, False)
if all((2 * i[0][1] <= i[x][1] for x in range(1, 4))):
	a = True
if all((i[3][1] >= 2 * i[y][1] for y in range(3))):
	b = True
if a == b:
	print('C')
elif a == True:
	print('ABCD'[i[0][0]])
else:
	print('ABCD'[i[3][0]])


lenList = [0] * 4
for i in range(4):
	x = input()
	lenList[i] = (len(x) - 2, chr(ord('A') + i))
lenList.sort()
if lenList[0][0] * 2 <= lenList[1][0] and lenList[3][0] < 2 * lenList[2][0]:
	print(lenList[0][1])
elif lenList[3][0] >= 2 * lenList[2][0] and lenList[0][0] * 2 > lenList[1][0]:
	print(lenList[3][1])
else:
	print('C')


options = []
options.append(('A', len(input()[2:])))
options.append(('B', len(input()[2:])))
options.append(('C', len(input()[2:])))
options.append(('D', len(input()[2:])))
options.sort(key=lambda x: x[1])
greatcount = 0
great = 'C'
if options[0][1] * 2 <= options[1][1]:
	great = options[0][0]
	greatcount += 1
if options[3][1] >= options[2][1] * 2:
	if greatcount == 1:
		great = 'C'
	else:
		great = options[3][0]
print(great)


l1 = list(str(input()))
l2 = list(str(input()))
l3 = list(str(input()))
l4 = list(str(input()))
c = []
if len(l1) - 2 >= 2 * (len(l2) - 2) and len(l1) - 2 >= 2 * (len(l3) - 2) and (len(l1) - 2 >= 2 * (len(l4) - 2)) or (len(l2) - 2 >= 2 * (len(l1) - 2) and len(l3) - 2 >= 2 * (len(l1) - 2) and (len(l4) - 2 >= 2 * (len(l1) - 2))):
	c.append(1)
else:
	c.append(0)
if len(l2) - 2 >= 2 * (len(l1) - 2) and len(l2) - 2 >= 2 * (len(l3) - 2) and (len(l2) - 2 >= 2 * (len(l4) - 2)) or (len(l1) - 2 >= 2 * (len(l2) - 2) and len(l3) - 2 >= 2 * (len(l2) - 2) and (len(l4) - 2 >= 2 * (len(l2) - 2))):
	c.append(1)
else:
	c.append(0)
if len(l3) - 2 >= 2 * (len(l2) - 2) and len(l3) - 2 >= 2 * (len(l1) - 2) and (len(l3) - 2 >= 2 * (len(l4) - 2)) or (len(l2) - 2 >= 2 * (len(l3) - 2) and len(l1) - 2 >= 2 * (len(l3) - 2) and (len(l4) - 2 >= 2 * (len(l3) - 2))):
	c.append(1)
else:
	c.append(0)
if len(l4) - 2 >= 2 * (len(l2) - 2) and len(l4) - 2 >= 2 * (len(l3) - 2) and (len(l4) - 2 >= 2 * (len(l1) - 2)) or (len(l2) - 2 >= 2 * (len(l4) - 2) and len(l3) - 2 >= 2 * (len(l4) - 2) and (len(l1) - 2 >= 2 * (len(l4) - 2))):
	c.append(1)
else:
	c.append(0)
d = {0: 'A', 1: 'B', 2: 'C', 3: 'D'}
if c.count(1) > 1 or c.count(1) == 0:
	print('C')
else:
	for j in range(4):
		if c[j] == 1:
			print(d[j])


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)


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')


s = list()
for _ in range(4):
	s.append(len(input()) - 2)
l = sorted(s)
(mn, mx) = (l[0], l[3])
mn = l[0] if l[0] <= l[1] / 2 else 0
mx = l[3] if l[3] >= l[2] * 2 else 0
if not mn and mx:
	print(chr(s.index(mx) + ord('A')))
elif mn and (not mx):
	print(chr(s.index(mn) + ord('A')))
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')


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 = len(input()) - 2
b = len(input()) - 2
c = len(input()) - 2
d = len(input()) - 2
g = [a, b, c, d]
h = [a, b, c, d]
minPresent = False
maxPresent = False
g.sort()
if g[0] * 2 <= g[1]:
	minPresent = True
if g[3] >= g[2] * 2:
	maxPresent = True
toPrint = ['A', 'B', 'C', 'D']
if minPresent and (not maxPresent):
	print(toPrint[h.index(g[0])])
elif maxPresent and (not minPresent):
	print(toPrint[h.index(g[3])])
else:
	print('C')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
readint = lambda : int(sys.stdin.readline().rstrip('\r\n'))
readints = lambda : map(int, sys.stdin.readline().rstrip('\r\n').split())
readstr = lambda : sys.stdin.readline().rstrip('\r\n')
readstrs = lambda : map(str, sys.stdin.readline().rstrip('\r\n').split())
readarri = lambda : [int(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]
readarrs = lambda : [str(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]

def solve():
	choices = [readstr()[2:] for _ in range(4)]
	answers = set()
	for i in range(4):
		fnd = True
		for j in range(4):
			if j != i:
				if len(choices[i]) >= len(choices[j]) * 2:
					continue
				else:
					fnd = False
					break
		if fnd:
			answers.add(['A', 'B', 'C', 'D'][i])
	for i in range(4):
		fnd = True
		for j in range(4):
			if j != i:
				if len(choices[i]) * 2 <= len(choices[j]):
					continue
				else:
					fnd = False
					break
		if fnd:
			answers.add(['A', 'B', 'C', 'D'][i])
	if len(answers) > 1 or not len(answers):
		print('C')
		return
	for i in answers:
		print(i)

def main():
	t = 1
	for _ in range(t):
		solve()
main()


a = input()[2:]
b = input()[2:]
c = input()[2:]
d = input()[2:]
l = sorted([(len(x), ans) for (x, ans) in [(a, 'A'), (b, 'B'), (c, 'C'), (d, 'D')]])
if l[0][0] * 2 <= l[1][0] and l[2][0] * 2 <= l[3][0]:
	print('C')
elif l[0][0] * 2 <= l[1][0]:
	print(l[0][1])
elif l[2][0] * 2 <= l[3][0]:
	print(l[3][1])
else:
	print('C')


a = input()
b = input()
c = input()
d = input()
list = [[len(a) - 2, 'A'], [len(b) - 2, 'B'], [len(c) - 2, 'C'], [len(d) - 2, 'D']]
list.sort()
ans = ''
t1 = False
t2 = False
if list[0][0] * 2 <= list[1][0]:
	ans = list[0][1]
	t1 = True
if list[-1][0] >= list[-2][0] * 2:
	ans = list[-1][1]
	t2 = True
if t1 and t2 or (t1 == False and t2 == False):
	ans = 'C'
print(ans)


choice = ['A', 'B', 'C', 'D']
size = []
(min_, max_, great, index) = (float('inf'), float('-inf'), 0, 0)
for i in range(4):
	ch = input()[2:]
	size.append((len(ch), i + 1))
	(min_, max_) = (min(len(ch), min_), max(len(ch), max_))
size.sort()
if min_ <= size[1][0] // 2:
	great += 1
	index = size[0][1]
if max_ >= size[-2][0] * 2:
	great += 1
	index = size[-1][1]
if great == 1:
	print(choice[index - 1])
else:
	print('C')


(a, b, c, d) = (input(), input(), input(), input())
(a, b, c, d) = (list(a), list(b), list(c), list(d))
(a, b, c, d) = (a[2:], b[2:], c[2:], d[2:])
(alen, blen, clen, dlen) = (len(a), len(b), len(c), len(d))
listt = []
listt.append([alen, 'A'])
listt.append([blen, 'B'])
listt.append([clen, 'C'])
listt.append([dlen, 'D'])
value1 = value2 = False
listt = sorted(listt)
if listt[0][0] * 2 <= listt[1][0]:
	value1 = True
if listt[3][0] >= listt[2][0] * 2:
	value2 = True
if value1 and value2:
	print('C')
elif value1:
	print(listt[0][1])
elif value2:
	print(listt[3][1])
else:
	print('C')


a = input()
b = input()
c = input()
d = input()
a1 = len(a) - 2
b1 = len(b) - 2
c1 = len(c) - 2
d1 = len(d) - 2
v = [a1, b1, c1, d1]
p = []
god = []
for i in range(4):
	k = []
	for j in range(4):
		if i != j:
			k.append(v[i] / v[j])
	p.append(k)
for i in range(4):
	t = 0
	k = 0
	for j in range(3):
		if p[i][j] >= 2:
			t = t + 1
		elif p[i][j] <= 0.5:
			k += 1
	if k == 0 and t == 3 or (t == 0 and k == 3):
		if i == 0:
			god.append('A')
		elif i == 1:
			god.append('B')
		elif i == 2:
			god.append('C')
		else:
			god.append('D')
if len(god) == 1:
	print(god[0])
else:
	print('C')


s1 = input()
s2 = input()
s3 = input()
s4 = input()
l1 = len(s1) - 2
l2 = len(s2) - 2
l3 = len(s3) - 2
l4 = len(s4) - 2
l = [l1, l2, l3, l4]
i = l.index(min(l))
r = l.index(max(l))
c1 = 0
j = 0
while j < 4:
	if j != i:
		if l[i] <= l[j] // 2:
			j = j + 1
		else:
			c1 = 1
			break
	else:
		j = j + 1
c2 = 0
j = 0
while j < 4:
	if j != r:
		if l[r] >= l[j] * 2:
			j = j + 1
		else:
			c2 = 1
			break
	else:
		j = j + 1
if c1 == 0 and c2 == 1:
	if i == 0:
		print('A')
	elif i == 1:
		print('B')
	elif i == 2:
		print('C')
	elif i == 3:
		print('D')
elif c1 == 1 and c2 == 0:
	if r == 0:
		print('A')
	elif r == 1:
		print('B')
	elif r == 2:
		print('C')
	elif r == 3:
		print('D')
else:
	print('C')


a = []
k = 0
for i in range(4):
	a.append(str(input())[2:])
for i in range(4):
	(shorter, longer) = (True, True)
	for j in range(4):
		if i != j:
			if len(a[i]) * 2 > len(a[j]):
				shorter = False
			if len(a[j]) * 2 > len(a[i]):
				longer = False
	if longer or shorter:
		k += 1
		ans = i
if k == 1:
	print(chr(ord('A') + ans))
else:
	print('C')


a = len(input()) - 2
b = len(input()) - 2
c = len(input()) - 2
d = len(input()) - 2
ans = ''
if a * 2 <= b and a * 2 <= c and (a * 2 <= d) or (b * 2 <= a and c * 2 <= a and (d * 2 <= a)):
	ans += 'A'
if b * 2 <= a and b * 2 <= c and (b * 2 <= d) or (a * 2 <= b and c * 2 <= b and (d * 2 <= b)):
	ans += 'B'
if c * 2 <= b and c * 2 <= a and (c * 2 <= d) or (b * 2 <= c and a * 2 <= c and (d * 2 <= c)):
	ans += 'C'
if d * 2 <= b and d * 2 <= c and (d * 2 <= a) or (b * 2 <= d and c * 2 <= d and (a * 2 <= d)):
	ans += 'D'
if len(ans) == 1:
	print(ans)
else:
	print('C')


choice = list()
for i in range(4):
	choice.append(len(input()) - 2)
great = -1
for i in range(4):
	shorter = 0
	longer = 0
	for j in range(4):
		if j == i:
			continue
		if 2 * choice[i] <= choice[j]:
			shorter += 1
		if choice[i] >= 2 * choice[j]:
			longer += 1
	if shorter == 3 or longer == 3:
		if great == -1:
			great = i
		else:
			print('C')
			quit()
if great == -1 or great == 2:
	print('C')
elif great == 0:
	print('A')
elif great == 1:
	print('B')
elif great == 3:
	print('D')


def check(a, b, c, d):
	if a >= b * 2 and a >= c * 2 and (a >= d * 2) or (a * 2 <= b and a * 2 <= c and (a * 2 <= d)):
		return 1
	else:
		return 0
a = len(input()) - 2
b = len(input()) - 2
c = len(input()) - 2
d = len(input()) - 2
ans = ['A', 'B', 'C', 'D']
cnt = [check(a, b, c, d), check(b, a, c, d), check(c, a, b, d), check(d, a, b, c)]
if sum(cnt) == 1:
	for i in range(len(cnt)):
		if cnt[i] == 1:
			print(ans[i])
else:
	print('C')


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
A = input()[2:]
B = input()[2:]
C = input()[2:]
D = input()[2:]
lenA = len(A)
lenB = len(B)
lenC = len(C)
lenD = len(D)
length = [lenA, lenB, lenC, lenD]
count = 0
mini = min(min(lenB, lenC), lenD)
maxi = max(max(lenB, lenC), lenD)
if 2 * lenA <= mini or lenA >= 2 * maxi:
	count += 1
	ans = 'A'
mini = min(min(lenA, lenC), lenD)
maxi = max(max(lenA, lenC), lenD)
if 2 * lenB <= mini or lenB >= 2 * maxi:
	count += 1
	ans = 'B'
mini = min(min(lenB, lenA), lenD)
maxi = max(max(lenB, lenA), lenD)
if 2 * lenC <= mini or lenC >= 2 * maxi:
	count += 1
	ans = 'C'
mini = min(min(lenB, lenC), lenA)
maxi = max(max(lenB, lenC), lenA)
if 2 * lenD <= mini or lenD >= 2 * maxi:
	count += 1
	ans = 'D'
if count == 1:
	print(ans)
else:
	print('C')


a = len(input().split('.')[1])
b = len(input().split('.')[1])
c = len(input().split('.')[1])
d = len(input().split('.')[1])
arr = [a, b, c, d]
one = False
two = False
for i in range(4):
	l = arr[i]
	c1 = c2 = 0
	for j in range(4):
		if i != j:
			if l <= arr[j] // 2:
				c1 += 1
			elif l >= arr[j] * 2:
				c2 += 1
	if c1 == 3:
		one = True
		ans = i
	elif c2 == 3:
		two = True
		ans = i
if one and (not two) or (two and (not one)):
	if ans == 0:
		print('A')
	elif ans == 1:
		print('B')
	elif ans == 2:
		print('C')
	else:
		print('D')
else:
	print('C')


a = str(input())
b = str(input())
c = str(input())
d = str(input())
first = len(a)
second = len(b)
third = len(c)
fourth = len(d)
count1 = 0
count2 = 0
count3 = 0
count4 = 0
if first - 2 >= 2 * (second - 2):
	count1 += 1
if first - 2 >= 2 * (third - 2):
	count1 += 1
if first - 2 >= 2 * (fourth - 2):
	count1 += 1
if 2 * (first - 2) <= second - 2:
	count1 -= 1
if 2 * (first - 2) <= third - 2:
	count1 -= 1
if 2 * (first - 2) <= fourth - 2:
	count1 -= 1
if second - 2 >= 2 * (first - 2):
	count2 += 1
if second - 2 >= 2 * (third - 2):
	count2 += 1
if second - 2 >= 2 * (fourth - 2):
	count2 += 1
if 2 * (second - 2) <= first - 2:
	count2 -= 1
if 2 * (second - 2) <= third - 2:
	count2 -= 1
if 2 * (second - 2) <= fourth - 2:
	count2 -= 1
if third - 2 >= 2 * (first - 2):
	count3 += 1
if third - 2 >= 2 * (second - 2):
	count3 += 1
if third - 2 >= 2 * (fourth - 2):
	count3 += 1
if 2 * (third - 2) <= first - 2:
	count3 -= 1
if 2 * (third - 2) <= second - 2:
	count3 -= 1
if 2 * (third - 2) <= fourth - 2:
	count3 -= 1
if fourth - 2 >= 2 * (first - 2):
	count4 += 1
if fourth - 2 >= 2 * (second - 2):
	count4 += 1
if fourth - 2 >= 2 * (third - 2):
	count4 += 1
if 2 * (fourth - 2) <= first - 2:
	count4 -= 1
if 2 * (fourth - 2) <= second - 2:
	count4 -= 1
if 2 * (fourth - 2) <= third - 2:
	count4 -= 1
if (count1 == 3 or count1 == -3) and (count2 != 3 and count2 != -3) and (count3 != 3 and count3 != -3) and (count4 != 3 and count4 != -3):
	print('A')
elif (count1 != 3 and count1 != -3) and (count2 == 3 or count2 == -3) and (count3 != 3 and count3 != -3) and (count4 != 3 and count4 != -3):
	print('B')
elif (count1 != 3 and count1 != -3) and (count2 != 3 and count2 != -3) and (count3 == 3 or count3 == -3) and (count4 != 3 and count4 != -3):
	print('C')
elif (count1 != 3 and count1 != -3) and (count2 != 3 and count2 != -3) and (count3 != 3 or count3 != -3) and (count4 == 3 or count4 == -3):
	print('D')
else:
	print('C')


A = (len(input().split('.')[1]), 'A')
B = (len(input().split('.')[1]), 'B')
C = (len(input().split('.')[1]), 'C')
D = (len(input().split('.')[1]), 'D')
tab = sorted([A, B, C, D])
if tab[0][0] * 2 <= tab[1][0] and tab[-1][0] < tab[-2][0] * 2:
	print(tab[0][1])
elif tab[-1][0] >= tab[-2][0] * 2 and tab[0][0] * 2 > tab[1][0]:
	print(tab[-1][1])
else:
	print('C')


import os
sa = input()
sa = len(sa) - 2
sb = input()
sb = len(sb) - 2
sc = input()
sc = len(sc) - 2
sd = input()
sd = len(sd) - 2
arr = [sa, sb, sc, sd]
arr.sort()
z = []
if arr[0] <= arr[1] // 2 and arr[0] <= arr[2] // 2 and (arr[0] <= arr[3] // 2):
	if arr[0] == sa:
		z.append('A')
	elif arr[0] == sb:
		z.append('B')
	elif arr[0] == sc:
		z.append('C')
	else:
		z.append('D')
if arr[0] <= arr[3] // 2 and arr[1] <= arr[3] // 2 and (arr[2] <= arr[3] // 2):
	if arr[3] == sa:
		z.append('A')
	elif arr[3] == sb:
		z.append('B')
	elif arr[3] == sc:
		z.append('C')
	else:
		z.append('D')
if len(z) == 1:
	print(z[0])
else:
	print('C')


lines = list()
for i in range(4):
	lines.append([len(str(input())) - 2, i])
lines.sort(key=lambda x: x[0])
values = list()
if lines[0][0] * 2 <= lines[1][0]:
	values.append(lines[0][1])
if lines[2][0] * 2 <= lines[3][0]:
	values.append(lines[3][1])
refer = 'ABCD'
if len(values) == 1:
	print(refer[values[0]])
else:
	print('C')


from operator import itemgetter

def the_child_and_homework(answers_list: list) -> str:
	answers_list.sort(key=itemgetter(1))
	min_len = answers_list[0][1]
	choice = ''
	choices = ''
	if min_len == answers_list[1][1]:
		choice = 'C'
	elif answers_list[1][1] >= 2 * min_len:
		choices += answers_list[0][0]
	else:
		choice = 'C'
	max_len = answers_list[-1][1]
	if max_len == answers_list[-2][1]:
		choice = 'C'
	elif max_len >= 2 * answers_list[-2][1]:
		choices += answers_list[-1][0]
	else:
		choice = 'C'
	if len(choices) == 1:
		return choices
	else:
		return 'C'
answers = []
for each in 'ABCD':
	answer = input()
	answers.append((each, len(answer[2:])))
print(the_child_and_homework(answers))


MC = ['A', 'B', 'C', 'D']
lengths = []
for t in range(4):
	lengths.append(len(input()) - 2)
lengths1 = lengths[:]
lengths.sort()
if lengths[0] * 2 <= lengths[1] and lengths[2] * 2 > lengths[3]:
	print(MC[lengths1.index(lengths[0])])
elif lengths[2] * 2 <= lengths[3] and lengths[0] * 2 > lengths[1]:
	print(MC[lengths1.index(lengths[-1])])
else:
	print('C')


a = len(input()) - 2
b = len(input()) - 2
c = len(input()) - 2
d = len(input()) - 2
great = []
if 2 * a <= b and 2 * a <= c and (2 * a <= d):
	great.append('A')
elif 2 * b <= a and 2 * b <= c and (2 * b <= d):
	great.append('B')
elif 2 * c <= a and 2 * c <= b and (2 * c <= d):
	great.append('C')
elif 2 * d <= a and 2 * d <= b and (2 * d <= c):
	great.append('D')
if a >= 2 * b and a >= 2 * c and (a >= 2 * d):
	great.append('A')
elif b >= 2 * a and b >= 2 * c and (b >= 2 * d):
	great.append('B')
elif c >= 2 * a and c >= 2 * b and (c >= 2 * d):
	great.append('C')
elif d >= 2 * a and d >= 2 * b and (d >= 2 * c):
	great.append('D')
if len(great) == 1:
	print(great[0])
else:
	print('C')


s1 = input()
s2 = input()
s3 = input()
s4 = input()
l1 = len(s1) - 2
l2 = len(s2) - 2
l3 = len(s3) - 2
l4 = len(s4) - 2
ll = [[l1, 'A'], [l2, 'B'], [l3, 'C'], [l4, 'D']]
ll.sort()
if ll[0][0] <= ll[1][0] / 2 and ll[-1][0] >= ll[-2][0] * 2:
	print('C')
elif ll[0][0] <= ll[1][0] / 2:
	print(ll[0][1])
elif ll[-1][0] >= ll[-2][0] * 2:
	print(ll[-1][1])
else:
	print('C')


l1 = []
for i in range(4):
	l1.append((len(input()) - 2, i))
l1.sort()
(ans1, ans2) = (-1, -1)
if 2 * l1[0][0] <= l1[1][0]:
	ans1 = l1[0][1]
if 2 * l1[2][0] <= l1[3][0]:
	ans2 = l1[3][1]
if ans1 == -1 and ans2 == -1:
	print('C')
elif ans1 != -1 and ans2 != -1:
	print('C')
elif ans1 == -1:
	print(chr(ans2 + 65))
else:
	print(chr(ans1 + 65))


num = []
num.append(len(input()) - 2)
num.append(len(input()) - 2)
num.append(len(input()) - 2)
num.append(len(input()) - 2)
temp = min(num)
index = num.index(temp)
count = 0
for i in range(4):
	if i != index and num[i] >= 2 * temp:
		count += 1
temp = max(num)
index1 = num.index(temp)
count1 = 0
for i in range(4):
	if i != index1 and num[i] * 2 <= temp:
		count1 += 1
if count == 3 and count1 != 3:
	print('A' if index == 0 else 'B' if index == 1 else 'C' if index == 2 else 'D')
elif count1 == 3 and count != 3:
	print('A' if index1 == 0 else 'B' if index1 == 1 else 'C' if index1 == 2 else 'D')
else:
	print('C')


a = len(input()) - 2
b = len(input()) - 2
c = len(input()) - 2
d = len(input()) - 2
l = [(a, 'A'), (b, 'B'), (c, 'C'), (d, 'D')]
l.sort()
s = False
if l[0][0] * 2 <= l[1][0]:
	s = l[0][1]
if l[2][0] * 2 <= l[3][0]:
	if s:
		print('C')
		exit()
	s = l[3][1]
if s:
	print(s)
else:
	print('C')


a = [len(input().strip()[2:]) for i in range(4)]
wond = set()
for i in range(4):
	good = 1
	for j in range(4):
		if i != j and a[i] > a[j] // 2:
			good = 0
	if good:
		wond.add(i)
for i in range(4):
	good = 1
	for j in range(4):
		if i != j and a[i] // 2 < a[j]:
			good = 0
	if good:
		wond.add(i)
d = {0: 'A', 1: 'B', 2: 'C', 3: 'D'}
if len(wond) != 1:
	print('C')
else:
	print(d[list(wond)[0]])


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')


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 getChar(x):
	if x == 0:
		return 'A'
	if x == 1:
		return 'B'
	if x == 2:
		return 'C'
	return 'D'
arr = []
for i in range(4):
	s = input()
	arr.append((i, s[2:]))
for i in range(4):
	for j in range(i + 1, 4):
		if len(arr[j][1]) < len(arr[i][1]):
			tmp = arr[j]
			arr[j] = arr[i]
			arr[i] = tmp
counter = 0
great = -1
if len(arr[0][1]) * 2 <= len(arr[1][1]):
	great = arr[0][0]
	counter = counter + 1
if len(arr[3][1]) >= len(arr[2][1]) * 2:
	great = arr[3][0]
	counter = counter + 1
if counter == 2 or counter == 0:
	print('C')
else:
	print(getChar(great))


a = input().strip()[2:]
b = input().strip()[2:]
c = input().strip()[2:]
d = input().strip()[2:]
res = ['A', 'B', 'C', 'D']
arr = [len(a), len(b), len(c), len(d)]
mic = 0
mac = 0
m1 = 0
m2 = 0
for i in range(4):
	temp = 0
	temp1 = 0
	for j in range(4):
		if i == j:
			continue
		if arr[i] <= arr[j] / 2:
			temp += 1
		elif arr[i] >= arr[j] * 2:
			temp1 += 1
	if temp == 3:
		mic += 1
		m1 = i
	elif temp1 == 3:
		mac += 1
		m2 = i
if mac == 1 and mic == 1:
	print(res[2])
elif mac == 1:
	print(res[m2])
elif mic == 1:
	print(res[m1])
else:
	print(res[2])


mcqs = {}
coding = {0: 'A', 1: 'B', 2: 'C', 3: 'D'}
for i in range(4):
	opt = input()
	mcqs[i] = len(opt) - 2
sorted_mcqs = sorted(mcqs, key=mcqs.get)
(minn, maxx) = (mcqs[sorted_mcqs[0]], mcqs[sorted_mcqs[-1]])
if maxx / minn < 2:
	print('C')
else:
	ismin = True
	ismax = True
	for x in sorted_mcqs[1:-1]:
		t = mcqs[x]
		if t < 2 * minn:
			ismin = False
		if t > maxx / 2:
			ismax = False
	if ismin and ismax or (not ismin and (not ismax)):
		print('C')
	elif ismin:
		print(coding[sorted_mcqs[0]])
	else:
		print(coding[sorted_mcqs[-1]])


Astr = input()
Bstr = input()
Cstr = input()
Dstr = input()
A_len = len(Astr[2:])
B_len = len(Bstr[2:])
C_len = len(Cstr[2:])
D_len = len(Dstr[2:])
arr = [A_len, B_len, C_len, D_len]
det = 'ABCD'
last_det = []
for i in range(4):
	last_arr = arr.copy()
	last_arr.pop(i)
	if arr[i] >= 2 * last_arr[0] and arr[i] >= 2 * last_arr[1] and (arr[i] >= 2 * last_arr[2]):
		last_det.append(det[i])
for j in range(4):
	last_arr = arr.copy()
	last_arr.pop(j)
	if arr[j] <= 1 / 2 * last_arr[0] and arr[j] <= 1 / 2 * last_arr[1] and (arr[j] <= 1 / 2 * last_arr[2]):
		last_det.append(det[j])
if len(last_det) == 1:
	print(last_det[0])
else:
	print('C')


z = [len(input()[2:]) for _ in ' ' * 4]
(s, g) = (-1, -1)
for i in range(4):
	ok = 1
	for j in range(4):
		if i != j and 2 * z[i] > z[j]:
			ok = 0
	if ok:
		s = i
for i in range(4):
	ok = 1
	for j in range(4):
		if i != j and z[i] < 2 * z[j]:
			ok = 0
	if ok:
		g = i
if s != -1 and g != -1:
	print('C')
elif s != -1:
	print(chr(65 + s))
elif g != -1:
	print(chr(65 + g))
else:
	print('C')


def get_key(x):
	for (key, value) in dicti.items():
		if x == value:
			return key
a = input()
b = input()
c = input()
d = input()
count1 = 0
count2 = 0
arr = [len(a) - 2, len(b) - 2, len(c) - 2, len(d) - 2]
dicti = {'A': len(a) - 2, 'B': len(b) - 2, 'C': len(c) - 2, 'D': len(d) - 2}
arr.sort()
if arr[0] * 2 <= arr[1]:
	count1 += 1
if arr[-1] >= 2 * arr[-2]:
	count2 += 1
if count1 == count2:
	print('C')
elif count1 == 1:
	print(get_key(arr[0]))
elif count2 == 1:
	print(get_key(arr[-1]))


a = len(input()[2:])
b = len(input()[2:])
c = len(input()[2:])
d = len(input()[2:])
(cnt, res) = (0, 'C')
if 2 * a <= min(b, c, d) or a >= 2 * max(b, c, d):
	cnt += 1
	res = 'A'
if 2 * b <= min(a, c, d) or b >= 2 * max(a, c, d):
	cnt += 1
	res = 'B'
if 2 * c <= min(a, b, d) or c >= 2 * max(a, b, d):
	cnt += 1
	res = 'C'
if 2 * d <= min(a, b, c) or d >= 2 * max(a, b, c):
	cnt += 1
	res = 'D'
print('C' if cnt > 1 else res)


s = []
for _ in range(4):
	t = list(input())
	s.append(len(t) - 2)
p = s[:]
d = ['A', 'B', 'C', 'D']
s.sort()
sw = 0
sw2 = 0
if s[1] >= 2 * s[0]:
	sw = 1
if s[3] >= 2 * s[2]:
	sw2 = 1
if sw and (not sw2):
	print(d[p.index(s[0])])
elif sw2 and (not sw):
	print(d[p.index(s[3])])
else:
	print('C')


n = sorted([(i, len(input()[2:])) for i in ['A', 'B', 'C', 'D']], key=lambda x: x[1])
r = 'C'
if 2 * n[0][1] <= n[1][1]:
	if 2 * n[2][1] > n[3][1]:
		r = n[0][0]
elif 2 * n[2][1] <= n[3][1]:
	r = n[3][0]
print(r)


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])])


len_lst = []
for i in range(4):
	option = input().strip()
	len_lst.append(len(option) - 2)
sort_lst = sorted(len_lst)
great = 0
if sort_lst[1] >= 2 * sort_lst[0]:
	great += 1
	key = sort_lst[0]
if sort_lst[3] >= 2 * sort_lst[2]:
	great -= 1
	key = sort_lst[3]
dic = {len_lst[0]: 'A', len_lst[1]: 'B', len_lst[2]: 'C', len_lst[3]: 'D'}
if great:
	print(dic[key])
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')


p = {__: len(input()) - 2 for __ in 'ABCD'}
from math import floor
las = None
tot = 0
for i in p:
	if all([2 * p[i] <= p[j] for j in p if i != j]) or all([p[i] >= p[j] * 2 for j in p if i != j]):
		las = i
		tot += 1
if las != None and tot == 1:
	print(las)
else:
	print('C')


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')


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')


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')


lis = []
for i in range(4):
	lis.append(len(input()) - 2)
pos = []
if lis[1] // lis[0] >= 2 and lis[2] // lis[0] >= 2 and (lis[3] // lis[0] >= 2) or (lis[0] // lis[1] >= 2 and lis[0] // lis[2] >= 2 and (lis[0] // lis[3] >= 2)):
	pos.append('A')
if lis[0] // lis[1] >= 2 and lis[2] // lis[1] >= 2 and (lis[3] // lis[1] >= 2) or (lis[1] // lis[0] >= 2 and lis[1] // lis[2] >= 2 and (lis[1] // lis[3] >= 2)):
	pos.append('B')
if lis[1] // lis[2] >= 2 and lis[0] // lis[2] >= 2 and (lis[3] // lis[2] >= 2) or (lis[2] // lis[1] >= 2 and lis[2] // lis[0] >= 2 and (lis[2] // lis[3] >= 2)):
	pos.append('C')
if lis[1] // lis[3] >= 2 and lis[2] // lis[3] >= 2 and (lis[0] // lis[3] >= 2) or (lis[3] // lis[1] >= 2 and lis[3] // lis[2] >= 2 and (lis[3] // lis[0] >= 2)):
	pos.append('D')
if len(pos) == 1:
	print(pos[0])
else:
	print('C')


a = input()
na = len(a) - 2
b = input()
nb = len(b) - 2
c = input()
nc = len(c) - 2
d = input()
nd = len(d) - 2
a = a[2:]
b = b[2:]
c = c[2:]
d = d[2:]
al = a.lower()
au = a.upper()
if al == au:
	na = 0
bl = b.lower()
bu = b.upper()
if bl == bu:
	nb = 0
cl = c.lower()
cu = c.upper()
if cl == cu:
	nc = 0
dl = d.lower()
du = d.upper()
if dl == du:
	nd = 0
arr = [[na, 1], [nb, 2], [nc, 3], [nd, 4]]
arr.sort()
gc = 0
if arr[0][0] * 2 <= arr[1][0] and arr[0][0] * 2 <= arr[2][0] and (arr[0][0] * 2 <= arr[3][0]) and (arr[0][0] != 0):
	gc = arr[0][1]
if arr[3][0] >= arr[0][0] * 2 and arr[3][0] >= arr[1][0] * 2 and (arr[3][0] >= arr[2][0] * 2) and (arr[3][0] != 0):
	if gc == 0:
		gc = arr[3][1]
	else:
		gc = 3
if gc == 0:
	gc = 3
if gc == 1:
	print('A')
elif gc == 2:
	print('B')
elif gc == 3:
	print('C')
else:
	print('D')


A = input()
a = len(A[A.find('.') + 1:])
B = input()
b = len(B[B.find('.') + 1:])
C = input()
c = len(C[C.find('.') + 1:])
D = input()
d = len(D[D.find('.') + 1:])
ans = 'C'
g = 0
h = 0
if a >= 2 * b and a >= 2 * c and (a >= 2 * d):
	ans = 'A'
	g += 1
elif b >= 2 * a and b >= 2 * c and (b >= 2 * d):
	ans = 'B'
	g += 1
elif c >= 2 * a and c >= 2 * b and (c >= 2 * d):
	ans = 'C'
	g += 1
elif d >= 2 * a and d >= 2 * b and (d >= 2 * c):
	ans = 'D'
	g += 1
if a <= b // 2 and a <= c // 2 and (a <= d // 2):
	ans = 'A'
	h += 1
elif b <= a // 2 and b <= c // 2 and (b <= d // 2):
	ans = 'B'
	h += 1
elif c <= a // 2 and c <= b // 2 and (c <= d // 2):
	ans = 'C'
	h += 1
elif d <= a // 2 and d <= b // 2 and (d <= c // 2):
	ans = 'D'
	h += 1
if h > 0 and g > 0 or h > 1 or g > 1:
	print('C')
else:
	print(ans)


a = input()
b = input()
c = input()
d = input()
l = [len(a) - 2, len(b) - 2, len(c) - 2, len(d) - 2]
counter = 0
ans = 0
for i in range(0, len(l)):
	f = 1
	for j in range(0, len(l)):
		if i != j:
			if l[i] < 2 * l[j]:
				f = 0
				break
	if f == 1:
		counter = counter + 1
		ans = i
	f = 1
	for j in range(0, len(l)):
		if i != j:
			if 2 * l[i] > l[j]:
				f = 0
				break
	if f == 1:
		counter = counter + 1
		ans = i
if counter != 1 or ans == 2:
	print('C')
elif ans == 0:
	print('A')
elif ans == 1:
	print('B')
elif ans == 3:
	print('D')


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')


a = [len(input()) - 2 for x in range(4)]
b = sorted(a)
tall = True
if b[0] * 2 <= b[1] and b[2] * 2 <= b[3]:
	print('C')
	exit()
if b[0] * 2 <= b[1]:
	print(chr(65 + a.index(b[0])))
	exit()
elif b[2] * 2 <= b[3]:
	print(chr(65 + a.index(b[3])))
	exit()
print('C')


a = []
for i in range(4):
	a.append(len(input()) - 2)
ans = list('ABCD')
tosc = ''
for i in range(4):
	ok1 = 1
	ok2 = 1
	for j in range(4):
		if i == j:
			continue
		if a[i] < 2 * a[j]:
			ok1 = 0
		if a[i] * 2 > a[j]:
			ok2 = 0
	if any((ok1, ok2)):
		if tosc:
			tosc = 'C'
		else:
			tosc = ans[i]
print(tosc if tosc else 'C')


p = []
for i in range(4):
	p.append(len(str(input(''))))
l = {'A': p[0] - 2, 'B': p[1] - 2, 'C': p[2] - 2, 'D': p[3] - 2}
p = sorted(l.items(), key=lambda x: x[1])
if 2 * p[0][1] <= p[1][1] and p[-1][1] >= p[-2][1] * 2:
	print('C')
elif 2 * p[0][1] <= p[1][1]:
	print(p[0][0])
elif p[-1][1] >= p[-2][1] * 2:
	print(p[-1][0])
else:
	print('C')


a = len(input())
b = len(input())
c = len(input())
d = len(input())
a -= 2
b -= 2
c -= 2
d -= 2
count = 0
if a >= 2 * max(b, c, d) or a <= min(b, c, d) // 2:
	count += 1
	f = 'A'
if b >= 2 * max(a, c, d) or b <= min(a, c, d) // 2:
	count += 1
	f = 'B'
if c >= 2 * max(b, a, d) or c <= min(b, a, d) // 2:
	count += 1
	f = 'C'
if d >= 2 * max(b, c, a) or d <= min(b, c, a) // 2:
	count += 1
	f = 'D'
if count == 1:
	print(f)
else:
	print('C')


a = input()
b = input()
c = input()
d = input()
l = [[len(a) - 2, 'A'], [len(b) - 2, 'B'], [len(c) - 2, 'C'], [len(d) - 2, 'D']]
l = sorted(l)
tmp = 0
if l[0][0] * 2 <= l[1][0] and (not l[-1][0] >= l[-2][0] * 2):
	print(l[0][1])
elif l[-1][0] >= l[-2][0] * 2 and (not l[0][0] * 2 <= l[1][0]):
	print(l[-1][1])
else:
	print('C')


a = input()
b = input()
c = input()
d = input()
lst = [(len(a) - 2, 'A'), (len(b) - 2, 'B'), (len(c) - 2, 'C'), (len(d) - 2, 'D')]
f1 = 0
f2 = 0
lst.sort(key=lambda x: x[0], reverse=True)
if lst[0][0] >= 2 * lst[1][0]:
	f1 = 1
if lst[2][0] >= 2 * lst[3][0]:
	f2 = 1
if f1 and f2 or (not f1 and (not f2)):
	print('C')
elif f1:
	print(lst[0][1])
else:
	print(lst[3][1])


a = []
ans = ''
for i in range(4):
	a.append(len(input()) - 2)
for i in range(4):
	flag = True
	for j in range(4):
		if i != j:
			if a[i] * 2 > a[j]:
				flag = False
	if flag:
		ans += 'ABCD'[i]
	flag = True
	for j in range(4):
		if i != j:
			if a[i] < a[j] * 2:
				flag = False
	if flag:
		ans += 'ABCD'[i]
if len(ans) == 1:
	print(ans)
else:
	print('C')


a = input()
b = input()
c = input()
d = input()
dic = {'A': len(a[2:]), 'B': len(b[2:]), 'C': len(c[2:]), 'D': len(d[2:])}
max_count = 0
min_count = 0
max_len = max(dic.values())
min_len = min(dic.values())
for i in dic.values():
	if max_len >= i * 2 and i != max_len:
		max_count += 1
for i in dic.values():
	if min_len * 2 <= i and i != min_len:
		min_count += 1
if max_count == min_count:
	print('C')
elif max_count == 3:
	for i in dic:
		if dic[i] == max_len:
			print(i)
elif min_count == 3:
	for i in dic:
		if dic[i] == min_len:
			print(i)
else:
	print('C')


choice = []
for i in range(4):
	choice.append(len(input(' ')[2:]))
Shortest = True
Longest = True
cc = 0
ci = None
for i in range(4):
	Shortest = True
	Longest = True
	for j in range(4):
		if i == j:
			continue
		if choice[i] < choice[j] * 2:
			Longest = False
		if choice[i] * 2 > choice[j]:
			Shortest = False
	if Shortest:
		cc += 1
		ci = chr(65 + i)
	if Longest:
		cc += 1
		ci = chr(65 + i)
if cc == 1:
	print(ci)
else:
	print('C')


a = input()
b = input()
c = input()
d = input()
arr = [0] * 4
s = 'ABCD'
arr[0] = len(a) - 2
arr[1] = len(b) - 2
arr[2] = len(c) - 2
arr[3] = len(d) - 2
ans = ''
bigcnt = 0
for i in range(4):
	cnt = 0
	for j in range(4):
		if i != j and arr[j] * 2 <= arr[i]:
			cnt += 1
		elif i != j and arr[j] >= arr[i] * 2:
			cnt -= 1
	if cnt == 3 or cnt == -3:
		ans = s[i]
		bigcnt += 1
if bigcnt != 1:
	print('C')
else:
	print(ans)


def main():
	mode = 'filee'
	if mode == 'file':
		f = open('test.txt', 'r')
	get = lambda : [f.readline()[:-1] if mode == 'file' else input()]
	a = {}
	for i in range(4):
		[y] = get()
		a[chr(65 + i)] = len(y[2:])
	maxx = max(a.values())
	minn = min(a.values())
	for (i, j) in a.items():
		if j == minn:
			minn = [i, j]
			break
	for (i, j) in a.items():
		if j == maxx:
			maxx = [i, j]
			break
	found1 = True
	for (i, j) in a.items():
		if minn[1] == j and minn[0] == i:
			continue
		if minn[1] * 2 > j:
			found1 = False
			break
	found2 = True
	for (i, j) in a.items():
		if maxx[1] == j and maxx[0] == i:
			continue
		if maxx[1] < j * 2:
			found2 = False
			break
	if found1 and found2 or (not found1 and (not found2)):
		print('C')
		return
	elif found1:
		for (i, j) in a.items():
			if a[i] == minn[1] and i == minn[0]:
				print(i)
				return
	else:
		for (i, j) in a.items():
			if a[i] == maxx[1] and maxx[0] == i:
				print(i)
				return
	if mode == 'file':
		f.close()
main()


a = len(input()) - 2
b = len(input()) - 2
c = len(input()) - 2
d = len(input()) - 2
x = [a, b, c, d]
ans = []
for i in range(4):
	f = []
	for j in range(4):
		if i != j:
			if x[i] < x[j] // 2:
				f.append(1)
			elif x[i] > 2 * x[j]:
				f.append(2)
			elif x[i] == x[j] // 2 or x[i] == 2 * x[j]:
				f.append(3)
	if len(f) == 3 and (len(set(f)) == 1 or set(f) == {2, 3} or set(f) == {1, 3}):
		ans.append(i)
if len(ans) == 1:
	print(chr(65 + ans[0]))
else:
	print('C')


a = []
a.append(len(input()) - 2)
a.append(len(input()) - 2)
a.append(len(input()) - 2)
a.append(len(input()) - 2)
great = []
for i in range(4):
	temp = a[i]
	shor = True
	lon = True
	for j in range(4):
		if i != j and a[i] < 2 * a[j]:
			lon = False
		if i != j and a[i] > a[j] // 2:
			shor = False
	if lon or shor:
		great.append(i)
if len(great) == 1:
	print(chr(great[0] + ord('A')))
else:
	print('C')


(a, b, c, d) = (input(), input(), input(), input())
a = len(a) - 2
b = len(b) - 2
c = len(c) - 2
d = len(d) - 2
e = False
if 2 * a <= c and 2 * a <= b and (2 * a <= d) or (a >= 2 * c and a >= 2 * b and (a >= 2 * d)):
	e = 'A'
if 2 * b <= a and 2 * b <= c and (2 * b <= d) or (b >= 2 * a and b >= 2 * c and (b >= 2 * d)):
	if e == False:
		e = 'B'
	else:
		e = 'C'
if 2 * c <= a and 2 * c <= b and (2 * c <= d) or (c >= 2 * a and c >= 2 * b and (c >= 2 * d)):
	if e == False:
		e = 'C'
	else:
		e = 'C'
if 2 * d <= a and 2 * d <= b and (2 * d <= c) or (d >= 2 * a and d >= 2 * b and (d >= 2 * c)):
	if e == False:
		e = 'D'
	else:
		e = 'C'
if e == False:
	e = 'C'
print(e)


import math
q = 1
for _ in range(q):
	s1 = input()
	s2 = input()
	s3 = input()
	s4 = input()
	l1 = len(s1) - 2
	l2 = len(s2) - 2
	l3 = len(s3) - 2
	l4 = len(s4) - 2
	l = [l1, l2, l3, l4]
	ans = []
	for i in range(4):
		flag1 = True
		flag2 = True
		for j in range(4):
			if j != i:
				if 2 * l[i] > l[j]:
					flag1 = False
				if l[i] < 2 * l[j]:
					flag2 = False
		if flag1 or flag2:
			ans.append(i)
	if len(ans) == 1:
		print(chr(65 + ans[0]))
	else:
		print('C')


import sys, os
from math import sqrt, gcd, ceil, log, floor, sin, pi
from math import factorial as fact
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
from itertools import permutations
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))
read_f = lambda : list(map(float, input().strip().split()))
MOD = 10 ** 9 + 7

def f(arr):
	for i in range(len(arr) - 1):
		if arr[i] == arr[i + 1]:
			return False
	return True

def main():
	arr = [len(input()) - 3 for i in range(4)]
	(a, b) = ([0] * 4, [0] * 4)
	for i in range(4):
		for j in range(4):
			if i != j:
				if arr[i] * 2 <= arr[j]:
					a[i] += 1
				if arr[i] >= 2 * arr[j]:
					b[i] += 1
	s = 'ABCD'
	c = 0
	ans = 'C'
	for i in range(4):
		if a[i] == 3 or b[i] == 3:
			c += 1
			ans = s[i]
	if c > 1:
		print('C')
	else:
		print(ans)
main()


def condition(t, s1, s2, s3):
	(n1, n2, n3, n4) = (len(t[2:]), len(s1[2:]), len(s2[2:]), len(s3[2:]))
	if n1 >= 2 * n2 and n1 >= 2 * n3 and (n1 >= 2 * n4):
		return True
	elif 2 * n1 <= n2 and 2 * n1 <= n3 and (2 * n1 <= n4):
		return True
	return False

def homework(lst):
	x1 = condition(lst[0], lst[1], lst[2], lst[3])
	x2 = condition(lst[1], lst[0], lst[2], lst[3])
	x3 = condition(lst[2], lst[1], lst[0], lst[3])
	x4 = condition(lst[3], lst[1], lst[2], lst[0])
	if x1 and (not x2) and (not x3) and (not x4):
		return 'A'
	elif x2 and (not x1) and (not x3) and (not x4):
		return 'B'
	elif x3 and (not x1) and (not x2) and (not x4):
		return 'C'
	elif x4 and (not x1) and (not x2) and (not x3):
		return 'D'
	return 'C'
a = list()
for i in range(4):
	s = input()
	a.append(s)
print(homework(a))


def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def MAP2():
	return map(float, input().split())

def LIST():
	return list(map(int, input().split()))

def STRING():
	return input()
import string
import sys
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter, defaultdict
from math import *
from itertools import permutations, accumulate
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]

def check1(l):
	r = 0
	m = []
	for i in range(4):
		c = 0
		for j in range(4):
			if i != j:
				if l[j] >= 2 * l[i]:
					c += 1
		if c == 3:
			r += 1
			m.append(i)
	if r == 1:
		return m
	else:
		return -1

def check2(l):
	r = 0
	m = []
	for i in range(4):
		c = 0
		for j in range(4):
			if i != j:
				if 2 * l[j] <= l[i]:
					c += 1
		if c == 3:
			r += 1
			m.append(i)
	if r == 1:
		return m
	else:
		return -1
v = []
for i in range(4):
	x = STRING()
	x = x[2:]
	v.append(len(x))
k1 = check1(v)
k2 = check2(v)
flag = ['A', 'B', 'C', 'D']
if k1 != -1 and k2 == -1:
	print(flag[k1[0]])
elif k1 == -1 and k2 != -1:
	print(flag[k2[0]])
else:
	print('C')


__author__ = 'asmn'
import sys
description = [chr(i + ord('A')) + input().strip()[3:] for i in range(4)]
description.sort(key=lambda s: len(s))
long_exist = len(description[3]) >= len(description[2]) * 2
short_exist = len(description[0]) * 2 <= len(description[1])
if long_exist and (not short_exist):
	print(description[3][0])
elif short_exist and (not long_exist):
	print(description[0][0])
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 getIndex(n):
	if n == 0:
		return 'A'
	elif n == 1:
		return 'B'
	elif n == 2:
		return 'C'
	else:
		return 'D'
inp = []
for i in range(4):
	a = input()
	inp += [a.split('.')[1]]
li = []
for x in inp:
	li += [len(x)]
short = 2 * min(li)
count1 = 0
for i in li:
	if i >= short:
		count1 += 1
maxm = max(li) // 2
count2 = 0
for i in li:
	if i <= maxm:
		count2 += 1
if count1 == 3 and count2 != 3:
	print(getIndex(li.index(int(short // 2))))
elif count2 == 3 and count1 != 3:
	print(getIndex(li.index(int(maxm * 2))))
else:
	print('C')


(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')


a = input()
b = input()
c = input()
d = input()
a = a[2:]
flag = 0
b = b[2:]
c = c[2:]
d = d[2:]
a = len(a)
b = len(b)
c = len(c)
d = len(d)
ans = []
ans.append((a, 'A'))
ans.append((b, 'B'))
ans.append((c, 'C'))
ans.append((d, 'D'))
ans.sort()
answer = []
if ans[1][0] / ans[0][0] >= 2:
	answer.append(ans[0][1])
if ans[3][0] / ans[2][0] >= 2:
	answer.append(ans[3][1])
if len(answer) == 1:
	print(*answer)
else:
	print('C')


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


class IOHandlerObject(object):

	def getInput(self, mode=2):
		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
(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))


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')


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
B = len(input()) - 2
C = len(input()) - 2
D = len(input()) - 2
l = ['A', 'B', 'C', 'D']
l1 = [A, B, C, D]
r = []
q = []
for i in range(4):
	y = l1[i]
	l1.pop(i)
	if 2 * y <= min(l1):
		r.append(l[i])
	elif y >= 2 * max(l1):
		q.append(l[i])
	l1.insert(i, y)
if len(r) == 1 and len(q) != 1:
	print(*r)
elif len(q) == 1 and len(r) != 1:
	print(*q)
else:
	print('C')


a = input()
b = input()
c = input()
d = input()
cnta = 0
cntb = 0
cntc = 0
cntd = 0
x = len(a) - 2
y = len(b) - 2
z = len(c) - 2
w = len(d) - 2
if x >= 2 * y and x >= 2 * z and (x >= 2 * w) or (2 * x <= y and 2 * x <= z and (2 * x <= w)):
	cnta += 1
if y >= 2 * x and y >= 2 * z and (y >= 2 * w) or (2 * y <= x and 2 * y <= z and (2 * y <= w)):
	cntb += 1
if z >= 2 * y and z >= 2 * x and (z >= 2 * w) or (2 * z <= y and 2 * z <= x and (2 * z <= w)):
	cntc += 1
if w >= 2 * y and w >= 2 * z and (w >= 2 * x) or (2 * w <= y and 2 * w <= z and (2 * w <= x)):
	cntd += 1
if cnta > cntb and cnta > cntc and (cnta > cntd):
	print('A')
elif cntb > cnta and cntb > cntc and (cntb > cntd):
	print('B')
elif cntc > cnta and cntc > cntb and (cntc > cntd):
	print('C')
elif cntd > cnta and cntd > cntb and (cntd > cntc):
	print('D')
else:
	print('C')


a = input()
b = input()
c = input()
d = input()
arr = [len(a) - 2, len(b) - 2, len(c) - 2, len(d) - 2]
ak = min(arr)
am = max(arr)
(flag, flag2) = (0, 0)
for i in range(4):
	if 2 * ak <= arr[i]:
		flag += 1
	if am >= 2 * arr[i]:
		flag2 += 1
if flag2 >= 3 and flag < 3:
	print(chr(arr.index(am) + 65))
elif flag >= 3 and flag2 < 3:
	print(chr(arr.index(ak) + 65))
else:
	print('C')


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


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


a = len(str(input())[2:])
b = len(str(input())[2:])
c = len(str(input())[2:])
d = len(str(input())[2:])
cnt = 0
ans = 'C'
if 2 * a <= min(b, c, d) or a >= 2 * max(b, c, d):
	cnt += 1
	ans = 'A'
if 2 * b <= min(a, c, d) or b >= 2 * max(a, c, d):
	cnt += 1
	ans = 'B'
if 2 * c <= min(a, b, d) or c >= 2 * max(a, b, d):
	cnt += 1
	ans = 'C'
if 2 * d <= min(a, b, c) or d >= 2 * max(a, b, c):
	cnt += 1
	ans = 'D'
if cnt > 1:
	ans = 'C'
print(ans)


x = []
for i in range(4):
	x.append(len(input()) - 2)
n = 0
v = 0
for i in range(4):
	(a, b) = (0, 0)
	for j in range(4):
		if x[i] <= x[j] / 2:
			a += 1
	for j in range(4):
		if x[i] >= x[j] * 2:
			b += 1
	if a == 3 or b == 3:
		n += 1
		v = chr(65 + i)
if n == 1:
	print(v)
else:
	print('C')


import sys
(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')


def main():
	l = []
	c = []
	for i in range(4):
		l.append(input()[2:])
		c.append(len(l[-1]))
	g = [False] * 4
	for i in range(4):
		longer = 0
		shorter = 0
		for j in range(4):
			if i == j:
				continue
			if c[i] <= c[j] // 2:
				shorter += 1
			if c[i] >= c[j] * 2:
				longer += 1
		g[i] = (longer == 3) | (shorter == 3)
	if len(list(filter(lambda i: i, g))) > 1:
		return 'C'
	for i in range(4):
		if g[i]:
			return ['A', 'B', 'C', 'D'][i]
	return 'C'
print(main())


A = len(input()[2:])
B = len(input()[2:])
C = len(input()[2:])
D = len(input()[2:])
answer = 'C'
counter = 0
if all((A >= e * 2 for e in [B, C, D])) or all((A <= e // 2 for e in [B, C, D])):
	answer = 'A'
	counter += 1
if all((B >= e * 2 for e in [A, C, D])) or all((B <= e // 2 for e in [A, C, D])):
	answer = 'B'
	counter += 1
if all((C >= e * 2 for e in [A, B, D])) or all((C <= e // 2 for e in [A, B, D])):
	answer = 'C'
	counter += 1
if all((D >= e * 2 for e in [A, B, C])) or all((D <= e // 2 for e in [A, B, C])):
	answer = 'D'
	counter += 1
if counter == 1:
	print(answer)
else:
	print('C')


a = input()
b = input()
c = input()
d = input()
(a, b, c, d) = (a[2:], b[2:], c[2:], d[2:])
lens = [(0, len(a)), (1, len(b)), (2, len(c)), (3, len(d))]
lens = sorted(lens, key=lambda x: x[1])
(count, ind) = (0, -1)
mini = lens[0][1]
if mini <= lens[1][1] // 2:
	count += 1
	ind = lens[0][0]
maxi = lens[3][1]
if maxi >= 2 * lens[2][1]:
	count += 1
	ind = lens[3][0]
if count == 1:
	print(chr(ord('A') + ind))
else:
	print('C')


(list, temp) = ([], [])
for i in range(4):
	a = input()
	list.append(len(a) - 2)
temp = list.copy()
temp.sort()
if 2 * temp[0] <= temp[1] and temp[3] < 2 * temp[2]:
	ind = list.index(temp[0])
	print(chr(65 + ind))
elif temp[3] >= 2 * temp[2] and 2 * temp[0] > temp[1]:
	ind = list.index(temp[3])
	print(chr(65 + ind))
else:
	print('C')


a = input()
b = input()
c = input()
d = input()
l = [[len(a[2:]), 'A'], [len(b[2:]), 'B'], [len(c[2:]), 'C'], [len(d[2:]), 'D']]
l = sorted(l, key=lambda x: x[0])
c = 0
m = []
for i in range(1, 4):
	if 2 * l[0][0] <= l[i][0]:
		c += 1
if c == 3:
	m.append(l[0][1])
c = 0
for i in range(0, 3):
	if l[3][0] >= 2 * l[i][0]:
		c += 1
if c == 3:
	m.append(l[3][1])
if len(m) == 2 or len(m) == 0:
	print('C')
else:
	print(m[0])


a = list(input())
a.pop(0)
a.pop(0)
b = list(input())
b.pop(0)
b.pop(0)
c = list(input())
c.pop(0)
c.pop(0)
d = list(input())
d.pop(0)
d.pop(0)
list1 = [b, c, d]
list2 = [a, c, d]
list3 = [a, b, c]
list4 = [a, b, d]
empty = []
temp = 1
count = 0
count1 = 0
count2 = 0
for i in range(len(list1)):
	if len(a) >= len(list1[i]) * 2:
		count1 += 1
		continue
	if len(a) <= len(list1[i]) / 2:
		count2 += 1
		continue
	else:
		count += 1
		temp = 0
		break
if temp == 1 and (count1 == 3 or count2 == 3):
	empty.append('A')
count1 = 0
count2 = 0
temp = 1
for i in range(len(list2)):
	if len(b) >= len(list2[i]) * 2:
		count1 += 1
		continue
	if len(b) <= len(list2[i]) / 2:
		count2 += 1
		continue
	else:
		count += 1
		temp = 0
		break
if temp == 1 and (count1 == 3 or count2 == 3):
	empty.append('B')
count1 = 0
count2 = 0
temp = 1
for i in range(len(list3)):
	if len(d) >= len(list3[i]) * 2:
		count1 += 1
		continue
	elif len(d) <= len(list3[i]) / 2:
		count2 += 1
		continue
	else:
		count += 1
		temp = 0
		break
if temp == 1 and (count1 == 3 or count2 == 3):
	empty.append('D')
count1 = 0
count2 = 0
temp = 1
for i in range(len(list4)):
	if len(c) >= len(list4[i]) * 2:
		count1 += 1
		continue
	if len(a) <= len(list4[i]) / 2:
		count2 += 1
		continue
	else:
		count += 1
		temp = 0
		break
if temp == 1 and (count1 == 3 or count2 == 3):
	empty.append('C')
if len(empty) > 1 or len(empty) == 0:
	print('C')
else:
	print(empty[0])


import sys
import math
from sys import stdin, stdout

def sieve(N):
	primeNumbers = [True] * (N + 1)
	primeNumbers[0] = False
	primeNumbers[1] = False
	i = 2
	while i * i <= N:
		j = i
		if primeNumbers[j]:
			while j * i <= N:
				primeNumbers[j * i] = False
				j += 1
		i += 1
	return primeNumbers

def getPrime(N):
	primes = sieve(N)
	result = []
	for i in range(len(primes)):
		if primes[i]:
			result.append(i)
	return result

def factor(N):
	factors = []
	i = 1
	while i * i <= N:
		if N % i == 0:
			factors.append(i)
			if i != N // i:
				factors.append(N // i)
		i += 1
	return sorted(factors)

def reduceB(b):
	mod = 0
	for i in range(0, len(b)):
		mod = (mod * 10 + ord(b[i])) % 1000000007
	return mod

def gcd(a, b):
	if a < b:
		return gcd(b, a)
	if b == 0:
		return a
	return gcd(b, a % b)

def get_ints_in_variables():
	return map(int, sys.stdin.readline().strip().split())

def get_int():
	return int(input())

def get_ints_in_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

def get_string():
	return sys.stdin.readline().strip()

def main():
	A = len(input()) - 2
	B = len(input()) - 2
	C = len(input()) - 2
	D = len(input()) - 2
	count = 0
	res = []
	if 2 * A <= B and 2 * A <= C and (2 * A <= D):
		count += 1
		res.append('A')
	if 2 * B <= A and 2 * B <= C and (2 * B <= D):
		count += 1
		res.append('B')
	if 2 * C <= A and 2 * C <= B and (2 * C <= D):
		count += 1
		res.append('C')
	if 2 * D <= A and 2 * D <= B and (2 * D <= C):
		count += 1
		res.append('D')
	if A >= 2 * B and A >= 2 * C and (A >= 2 * D):
		count += 1
		res.append('A')
	if B >= 2 * A and B >= 2 * C and (B >= 2 * D):
		count += 1
		res.append('B')
	if C >= 2 * A and C >= 2 * B and (C >= 2 * D):
		count += 1
		res.append('C')
	if D >= 2 * A and D >= 2 * B and (D >= 2 * C):
		count += 1
		res.append('D')
	if count == 1:
		print(res[0])
	else:
		print('C')
main()


import itertools
import sys
from collections import defaultdict, Counter
from math import sqrt
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def s(d):
	dis = 1 + 4 * 2 * 3 * d
	ds = sqrt(dis)
	return (-1 + ds) / 6

def main():
	d = [len(input().strip()) - 2 for _ in range(4)]
	res = []
	for (i, v) in enumerate(d):
		c1 = [v * 2 <= v2 for (j, v2) in enumerate(d) if i != j]
		c2 = [v >= v2 * 2 for (j, v2) in enumerate(d) if i != j]
		if all(c1) or all(c2):
			res.append(i)
	if len(res) == 1:
		print(chr(ord('A') + res[0]))
	else:
		print('C')
main()


a = input()[2:]
b = input()[2:]
c = input()[2:]
d = input()[2:]
lst = [a, b, c, d]
lst.sort(key=len)
if 2 * len(lst[0]) <= len(lst[1]) and 2 * len(lst[2]) > len(lst[3]) or (2 * len(lst[0]) > len(lst[1]) and 2 * len(lst[2]) <= len(lst[3])):
	if 2 * len(lst[0]) <= len(lst[1]) and 2 * len(lst[2]) > len(lst[3]):
		if lst[0] == a:
			print('A')
		elif lst[0] == b:
			print('B')
		elif lst[0] == c:
			print('C')
		else:
			print('D')
	else:
		lst[0] = lst[-1]
		if lst[0] == a:
			print('A')
		elif lst[0] == b:
			print('B')
		elif lst[0] == c:
			print('C')
		else:
			print('D')
else:
	print('C')


mod = 1000000007
MOD = 998244353
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
it = lambda : tuple(map(int, input().split()))
ls = lambda : list(input())
l = []
for i in range(4):
	s = si()
	l.append([len(s) - 2, i])
l.sort()
if all((l[0][0] * 2 <= l[i][0] for i in range(1, 4))) and all((l[-1][0] // 2 >= l[i][0] for i in range(3))):
	print('C')
elif all((l[0][0] * 2 <= l[i][0] for i in range(1, 4))):
	print(chr(l[0][1] + ord('A')))
elif all((l[-1][0] // 2 >= l[i][0] for i in range(3))):
	print(chr(l[-1][1] + ord('A')))
else:
	print('C')


a = len(input()) - 2
b = len(input()) - 2
c = len(input()) - 2
d = len(input()) - 2
cnt = 0
ans = 'e'
if a >= b * 2 and a >= c * 2 and (a >= d * 2) or (a * 2 <= b and a * 2 <= c and (a * 2 <= d)):
	ans = 'A'
	cnt += 1
(a, b) = (b, a)
if a >= b * 2 and a >= c * 2 and (a >= d * 2) or (a * 2 <= b and a * 2 <= c and (a * 2 <= d)):
	ans = 'B'
	cnt += 1
(a, c) = (c, a)
if a >= b * 2 and a >= c * 2 and (a >= d * 2) or (a * 2 <= b and a * 2 <= c and (a * 2 <= d)):
	ans = 'C'
	cnt += 1
(a, d) = (d, a)
if a >= b * 2 and a >= c * 2 and (a >= d * 2) or (a * 2 <= b and a * 2 <= c and (a * 2 <= d)):
	ans = 'D'
	cnt += 1
if cnt > 1 or cnt == 0:
	ans = 'C'
print(ans)


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')
elif x[0][0] * 2 <= x[1][0]:
	print(x[0][1])
elif x[2][0] * 2 <= x[3][0]:
	print(x[3][1])
else:
	print('C')


import logging
import copy
import sys
import math
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)

def solve(lines):
	l = list(map(lambda x: len(x[2:]), lines))
	min_len = min(l)
	great = []
	others = list(filter(lambda x: x >= 2 * min_len, l))
	if len(others) == 3:
		great.append(l.index(min_len))
	max_len = max(l)
	others = list(filter(lambda x: 2 * x <= max_len, l))
	if len(others) == 3:
		great.append(l.index(max_len))
	if len(great) == 1:
		return 'ABCD'[great[0]]
	return 'C'

def main():
	lines = []
	for i in range(0, 4):
		lines.append(input())
	print(solve(lines))

def log(*message):
	logging.debug(message)
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')


a = input()[2:]
b = input()[2:]
c = input()[2:]
d = input()[2:]
di = {}
di[a] = 'A'
di[b] = 'B'
di[c] = 'C'
di[d] = 'D'
l = [a, b, c, d]
l.sort(key=lambda x: len(x))
(good1, good2) = (0, 0)
if 2 * len(l[0]) <= len(l[1]):
	good1 += 1
if len(l[3]) >= 2 * len(l[2]):
	good2 += 1
if good1 > 0 and good2 > 0:
	print('C')
elif good1 and (not good2):
	print(di[l[0]])
elif not good1 and good2:
	print(di[l[3]])
else:
	print('C')


from math import *
from collections import *
from sys import *
import string
import re
t = stdin.readline
p = stdout.write

def GI():
	return map(int, input().strip().split())

def GS():
	return map(str, t().strip().split())

def IL():
	return list(map(int, t().strip().split()))

def SL():
	return list(map(str, t().strip().split()))
a = sorted([(len(input()) - 2, i) for i in 'ABCD'])
c = 0
if a[0][0] * 2 <= a[1][0]:
	c += 1
if a[-2][0] * 2 <= a[-1][0]:
	c += 2
print(['C', a[0][1], a[-1][1], 'C'][c])


a = {'A': len(input()[2:]), 'B': len(input()[2:]), 'C': len(input()[2:]), 'D': len(input()[2:])}
mi = min(a.values())
ma = max(a.values())
l = list(a.values())
c = 0
s = 0
key_list = list(a.keys())
val_list = list(a.values())
for i in a.values():
	if i == mi:
		continue
	elif mi <= i / 2:
		c += 1
for i in a.values():
	if i == ma:
		continue
	if ma >= i * 2:
		s += 1
if c == 3 and s != 3:
	print(list(a.keys())[list(a.values()).index(mi)])
elif s == 3 and c != 3:
	print(list(a.keys())[list(a.values()).index(ma)])
else:
	print('C')