var a:array[1..100000] of longint;
    i,s:longint;
begin
for i:=1 to 4 do
read(a[i]);
for i:=1 to 4 do
if a[i]>=90 then inc(s);
if s=4 then write('A')
else if (s=3)or(s=2) then write('B')
else if s=1 then write('C')
else write('D');
end.
/**************************************************************
	Problem: 1735
	User: admin
	Language: Pascal
	Result: Wrong Answer
****************************************************************/