# ITP1_7_A
while True:
m,f,r = map(int,input().split(" "))
# 終了条件
if (m,f,r) == (-1,-1,-1):
break
if m==-1 or f==-1:
print("F")
elif m+f >= 80:
print("A")
elif m+f >= 65:
print("B")
elif m+f >= 50:
print("C")
elif m+f >= 30:
if r >= 50:
print("C")
else:
print("D")
else:
print("F")
# ITP1_7_B
while True:
n,x = map(int,input().split(" "))
# 終了条件
if n==0 and x==0:
break
cnt = 0
for i in range(1,n+1):
for j in range(1,i):
for k in range(1,j):
if i+j+k == x:
cnt += 1
print(cnt)
# ITP1_7_C
r,c = map(int,input().split(" "))
array = []
for _ in range(r):
row = list(map(int,input().split(" ")))
array.append(row)
# 列の和を追加する
for i in range(r):
sum_row = sum(array[i])
array[i].append(sum_row)
# 行の和を追加する
array.append([])
for i in range(c+1):
sum_col = 0
for j in range(r):
sum_col += array[j][i]
array[r].append(sum_col)
# リストの中身を文字列に直してjoinを使う
for i in range(r+1):
print(" ".join(list(map(str,array[i]))))
# ITP1_7_D
n,m,l = map(int,input().split(" "))
# 行列Aを受け取る
A = []
for i in range(n):
row = list(map(int,input().split(" ")))
A.append(row)
# 行列Bを受け取る
B = []
for i in range(m):
row = list(map(int,input().split(" ")))
B.append(row)
# (n,m)×(m,l)は(n,l)
C = [[0 for _ in range(l)] for _ in range(n)]
for i in range(n):
for j in range(l):
for k in range(m):
C[i][j] += A[i][k]*B[k][j]
# Cを表示
for i in range(n):
print(" ".join(list(map(str,C[i]))))