Problem:

Grading

  Write a program which reads a list of student test scores and evaluates the performance for each student.

  The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup examination r (out of 100). If the student does not take the examination, the score is indicated by -1.

  The final performance of a student is evaluated by the following procedure:

  
If the student does not take the midterm or final examination, the student's grade shall be F.

  
If the total score of the midterm and final examination is greater than or equal to 80, the student's grade shall be A.

  
If the total score of the midterm and final examination is greater than or equal to 65 and less than 80, the student's grade shall be B.

  
If the total score of the midterm and final examination is greater than or equal to 50 and less than 65, the student's grade shall be C.

  
If the total score of the midterm and final examination is greater than or equal to 30 and less than 50, the student's grade shall be D. However, if the score of the makeup examination is greater than or equal to 50, the grade shall be C.

  
If the total score of the midterm and final examination is less than 30, the student's grade shall be F.

Input

  The input consists of multiple datasets. For each dataset, three integers m, f and r are given in a line.

  The input ends with three -1 for m, f and r respectively. Your program should not process for the terminal symbols.

The number of datasets (the number of students) does not exceed 50.

Output

  For each dataset, print the grade (A, B, C, D or F) in a line.

Sample Input

40 42 -1
20 30 -1
0 2 -1
-1 -1 -1

Sample Output

A
C
F



Sample input:
40 42 -1
20 30 -1
0 2 -1
-1 -1 -1


Sample output:
A
C
F

Submission status: Wrong Answer

Solution code:

n = 0
while n == 0:
    m = map(int,raw_input().split())
    if m[0] + m[1] + m[2] == -3:
        break
    for i in xrange(2):
        if m[i] == -1:
            m[i] = 0
    k = m[0] + m[1]
    if m[0] == -1 or m[1] == -1:
        print "F"
    elif k >= 80:
        print "A"
    elif k >= 65:
        print "B"
    elif k >= 50:
        print "C"
    elif k >= 30:
        if m[2] >= 50:
            print "C"
        else:
            print "D"
    elif k < 30:
        print "F"

Submission status: Wrong Answer

Solution code:


n = 0
while n == 0:
    m = map(int,raw_input().split())
    if m[0] + m[1] + m[2] == -3:
        break
    if m[0] == -1 or m[1] == -1:
        print "F"
        break
    for i in xrange(2):
        if m[i] == -1:
            m[i] = 0
    k = m[0] + m[1]

    if k >= 80:
        print "A"
    elif k >= 65:
        print "B"
    elif k >= 50:
        print "C"
    elif k >= 30:
        if m[2] >= 50:
            print "C"
        else:
            print "D"
    elif k < 30:
        print "F"

Submission status: Wrong Answer

Solution code:
while 1:
	m,f,r=map(int,raw_input().split())
	if (m==-1 and f==-1 and r==-1):
		break
	elif (m+f>=80):
		print "A"
	elif (m+f>=65 and m+f<80):
		print "B"
	elif (m+f>=50 and m+f<65 or r>=50):
		print "C"
	elif (m+f>=30 and m+f<50 and r<50):
		print "D"
	elif (m+f<30):
		print "F"

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = map(int, input().split())
    A = m + f + r
    if m == f == r == -1:
        break
    elif m == 0 or f == 0:
        print('F')
    elif A >= 80:
        print('A')
    elif 65 <= A < 80:
        print('B')
    elif 50 <= A < 65:
        print('C')
    elif 30 <= A < 50:
        print('D')
    else:
        print('F')

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = map(int, input().split())
    A = m + f
    if m == f == r == -1:
        break
    elif m == 0 or f == 0:
        print('F')
    elif A >= 80:
        print('A')
    elif 65 <= A < 80:
        print('B')
    elif 50 <= A < 65:
        print('C')
    elif 30 <= A < 50:
        if 50 <= r:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Wrong Answer

Solution code:
while 1:
	m,f,r=map(int,raw_input().split())
	if (m==-1 and f==-1 and r==-1):
		break
	elif (m+f>=80):
		print "A"
	elif (m+f>=65 and m+f<80):
		print "B"
	elif (m+f>=50 and m+f<65 or r>=50):
		print "C"
	elif (m+f>=30 and m+f<50 and r<50 and m!=-1 and f!=-1):
		print "D"
	elif (m+f<30):
		print "F"

Submission status: Wrong Answer

Solution code:
while(True):
	score = [int(i) for i in input().split()]
	if score[:] == [-1,-1,-1]:
		break
	score_sum = score[0] + score[1]
	if score_sum >= 80:
		print('A')
	elif 80 > score_sum >= 65:
		print('B')
	elif 65 > score_sum >= 50:
		print('C')
	elif 50 > score_sum >= 35:
		if score[2] >= 30:
			print('C')
		else :
			print('D')
	elif 30 > score_sum or score[:1] == [-1,-1]:
		print('F')

Submission status: Wrong Answer

Solution code:
while(True):
	score = [int(i) for i in input().split()]
	if score[:] == [-1,-1,-1]:
		break
	score_sum = score[0] + score[1]
	if score[0] == -1 or score[1] == -1:
		print('F')
	elif score_sum >= 80:
		print('A')
	elif 80 > score_sum >= 65:
		print('B')
	elif 65 > score_sum >= 50:
		print('C')
	elif 50 > score_sum >= 35:
		if score[2] >= 30:
			print('C')
		else :
			print('D')
	elif 30 > score_sum:
		print('F')

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = map(int, input().split())
    total = m + f
    if m == f == r == -1:
        break
    elif 80 <= total:
        print("A")
    elif 65 <= total:
        print("B")
    elif 50 <= total:
        print("C")
    elif 30 <= total:
        if 50 <= r:
            print("C")
            continue
        print("D")
    else:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:

    m, f, r = map(int, input().split())
    if m==f==r== -1:
        break
    result = ""
    sum = m + f
    
    if (m==-1)or(f==-1):
        result = "F"
    elif sum >= 80:
        result = 'A'
    elif sum>= 65:
        result = "B"
    elif sum>=50:
        result = "C"
    elif sum>= 30:
        reult="D"
        if r>=50:
            result = 'C'
    else:
        result = 'F'

    print("{}".format(result))

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = map(int,input().split())
    if m == f == r == -1 :
        break
    if 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")

Submission status: Wrong Answer

Solution code:
while 1:
    m,f,r = map(int, input().split())
    if m == f == r == -1: break

    if m+f >= 80:
        print("A")
    elif 65 <= m+f < 80:
        print("B")
    elif 50 <= m+f < 65:
        print("C")
    elif 30 <= m+f < 50:
        if r >= 50:
            print("C")
        else:
            print("D")
    elif (m==f==-1) or (m+f < 30):
        print("F")

Submission status: Wrong Answer

Solution code:
while 1:
    m,f,r = map(int, input().split())
    if m == f == r == -1: break

    if m+f >= 80:
        print("A")
    elif 65 <= m+f < 80:
        print("B")
    elif 50 <= m+f < 65:
        print("C")
    elif 30 <= m+f < 50:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Wrong Answer

Solution code:
result = []
m,f,r=[int(x) for x in input().split()]
while not m==f==r==-1:
    if (m + f >= 80):
        res = 0
    elif (65 <= m + f < 80):
        res = 1
    elif (50 <= m + f < 65):
        res = 2
    elif (30 <= m + f < 50):
        res = 4
        if (50 <= r):
            res = 3
    else :
        res = 5
    result.append(res)
    m,f,r=[int(x) for x in input().split()]
for i in result:
    print(chr(65+i))

Submission status: Wrong Answer

Solution code:
result = []
m,f,r=[int(x) for x in input().split()]
while not m==f==r==-1:
    if (m + f >= 80):
        res = 0
    elif (65 <= m + f < 80):
        res = 1
    elif (50 <= m + f < 65):
        res = 2
    elif (30 <= m + f < 50):
        res = 3
        if (50 <= r):
            res = 2
    else :
        res = 5
    result.append(res)
    m,f,r=[int(x) for x in input().split()]
for i in result:
    print(chr(65+i))

Submission status: Wrong Answer

Solution code:
def judgetest(a, b, c):
    if a == -1 or b == -1:
        return 'F'
    sum = a + b
    if sum >= 80:
        return 'A'
    elif sum >= 65:
        return 'B'
    elif sum >= 50:
        return 'C'
    elif sum >= 35:
        if c >= 50:
            return 'C'
        else:
            return 'D'
    else:
        return 'F'

list = []
while True:
    a, b, c = map(int, input().split())
    if a == b == c == -1:
        break
    list.append(judgetest(a, b, c))

for s in list:
    print(s)

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r =[int(i) for i in input().split()]

    if m == f == r ==-1:
        break

    if (m+f) >=80:
        print("A")

    elif 65<=(m+f)<80:
        print("B")

    elif 50<=(m+f)<65 or r >=50:
        print("C")

    elif 30<=(m+f)<50:
        print("D")

    elif (m+f)<30:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r =[int(i) for i in input().split()]

    if m == f == r ==-1:
        break

    if (m+f) >=80:
        print("A")

    if 65<=(m+f)<80:
        print("B")

    if 50<=(m+f)<65 or r >=50:
        print("C")

    if 30<=(m+f)<50:
        print("D")

    if (m+f)<30:
        print("F")

Submission status: Wrong Answer

Solution code:
while 1:
    m, f, r = [int(i) for i in input().split()]
    if m == -1 and f == -1 and r == -1:
        break
    elif m == -1 or f == -1:
        print("F")
    elif m + f >= 80:
        print("A")
    elif m + f >= 65 < 80:
        print("B")
    elif m + f >= 50 < 65:
        print("C")
    elif m + f >= 30 < 50:
        print("D")
    elif m + f >= 30 < 50 and r >= 50:
        print("C")
    elif m + f < 30:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r =[int(i) for i in input().split()]

    if m == f == r ==-1:
        break

    if (m+f) >=80:
        print("A")

    elif 65<=(m+f)<80:
        print("B")

    elif 50<=(m+f)<65 :
        print("C")

    elif 30<=(m+f)<50 and r>=50:
        print("C")
        
    elif 30 <= (m + f) and r< 50:
        print("D")
        
    elif (m+f)<30:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r =[int(i) for i in input().split()]

    if m == f == r ==-1:
        break

    if (m+f) >=80:
        print("A")

    if 65<=(m+f)<80:
        print("B")

    if 50<=(m+f)<65 :
        print("C")

    if 30<=(m+f)<50 and r>=50:
        print("C")
        
    if 30 <= (m + f) and r< 50:
        print("D")
        
    if (m+f)<30:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    if m + f <= 80:
        print('A')
    if 65<= m + f <80:
        print('B')
    if 50 <= m+f < 65:
        print('C')
    if 30<= m+f < 50:
        print('D')
    if m+r <= 30:
        print('F')
    if 50 <= r:
        print('C')
    else:
        m+f+r-1

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    if m + f <= 80:
        print('A')
    if 65<= m + f <80:
        print('B')
    if 50 <= m+f < 65:
        print('C')
    if 30<= m+f < 50:
        print('D')
    if m+r <= 30:
        print('F')
    if 50 <= r:
        print('C')

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r =[int(i) for i in input().split()]

    if m == f == r ==-1:
        break

    elif (m+f) >=80:
        print("A")

    elif 65<=(m+f)<80:
        print("B")

    elif 50<=(m+f)<65 :
        print("C")

    elif 30 <= (m + f) and r< 50:
        if r>=50:
            print("C")
        else:
            print("D")


    elif (m+f)<30:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    if m or f -1:
        print('F')

    if m + f <= 80:
        print("A")

    if 80 >= m + f <= 65:
        print("B")

    if 65 >= m + f <= 50:
        print("C")

    if 50 >= m + f <= 30:
        if r >= 50:
            print("C")
        else:
            print("D")

    if m + f <= 30:
         print("F")
         
    print()

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    if m + f <= 80:
        print('A')
    if 65<= m + f <80:
        print('B')
    if 50 <= m+f < 65:
        print('C')
    if 30<= m+f < 50:
        print('D')
    if m+r < 30:
        print('F')
    if 50 <= r:
        print('C')

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r =[int(i) for i in input().split()]

    if m == f == r ==-1:
        break

    elif (m+f) >=80:
        print("A")

    elif 65<=(m+f)<80:
        print("B")

    elif 50<=(m+f)<65 :
        print("C")

    elif 30 <= (m + f)<50:
        if r>=50:
            print("C")
        else:
            print("D")


    elif (m+f)<30:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    if m or f -1:
        print("F")

    if m + f <= 80:
        print("A")

    if 80 >= m + f <= 65:
        print("B")

    if 65 >= m + f <= 50:
        print("C")

    if 50 >= m + f <= 30:
        if r >= 50:
            print("C")
        else:
            print("D")

    if m + f >= 30:
         print("F")

print()

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    elif m == -1 or f == -1:
        print("F")

    elif m + f >= 80:
        print("A")

    elif 65 <= m + f < 80:
        print("B")

    elif 50 <= m + f < 65:
        print("C")

    elif 30 <= m + f < 50:
        if r > 50:
            print("C")
        else:
            print("D")

    else:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    elif m == -1 or f == -1:
        print("F")

    elif m + f >= 80:
        print("A")

    elif 65 <= m + f < 80:
        print("B")

    elif 50 <= m + f < 65:
        print("C")

    elif 30 <= m + f < 50:
        if r > 50:
            print("C")
        else:
            print("D")

    elif m + f <= 30:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    elif m == -1 or f == -1:
        print("F")

    elif m + f >= 80:
        print("A")

    elif 65 <= m + f < 80:
        print("B")

    elif 50 <= m + f < 65:
        print("C")

    elif 30 <= m + f < 50:
        if r > 50:
            print("C")
        else:
            print("D")

    elif m + f < 30:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r =[int(i) for i in input().split()]

    if m == f == r ==-1:
        break

    if (m+f) >=80:
        print("A")

    if 65<=(m+f)<80:
        print("B")

    if 50<=(m+f)<65 :
        print("C")

    if 30<= (m + f)<50:
        if r>=50:
            print("C")
        else:
            print("D")

    if (m+f)<30:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    elif m == -1 or f == -1:
        print("F")

    elif m + f >= 80:
        print("A")

    elif 65 <= m + f < 80:
        print("B")

    elif 50 <= m + f < 65:
        print("C")

    elif 30 <= m + f < 50:
        if r > 50:
            print("C")
        else:
            print("D")

    elif m + f < 30:
        print("F")

    elif m + f < 30:
        print("F")

Submission status: Wrong Answer

Solution code:
while 1:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    elif m == -1 or f == -1:
        print("F")

    elif m + f >= 80:
        print("A")

    elif 65 <= m + f < 80:
        print("B")

    elif 50 <= m + f < 65:
        print("C")

    elif 30 <= m + f < 50:
        if r > 50:
            print("C")
        else:
            print("D")

    elif m + f < 30:
        print("F")

    elif m + f < 30:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r =[int(i) for i in input().split()]

    if m == f == r ==-1:
        break

    elif (m+f) >=80:
        print("A")

    elif 65<=(m+f)<80:
        print("B")

    elif 50<=(m+f)<65 :
        print("C")

    elif 30 <= (m + f)<50:
        if r>=50:
            print("C")
        else:
            print("D")


    elif (m+f)<30:
        print("F")

    elif m==-1 or f==-1:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r =[int(i) for i in input().split()]

    if m == f == r ==-1:
        break

    if (m+f) >=80:
        print("A")

    elif 65<=(m+f)<80:
        print("B")

    elif 50<=(m+f)<65 :
        print("C")

    elif 30 <= (m + f)<50:
        if r>=50:
            print("C")
        else:
            print("D")


    elif (m+f)<30:
        print("F")

    elif m==-1 or f==-1:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    if m + f <= 80:
        print('A')
    if 65<= m + f <80:
        print('B')
    if 50 <= m+f < 65:
        print('C')
    if 30<= m+f < 50:
        print('D')
    if m+r < 30:
        print('F')
    if 50 <= r:
        print('C')
    if m == -1 or f == -1:
        print('F')

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r =[int(i) for i in input().split()]

    if m == f == r ==-1:
        break

    if (m+f) >=80:
        print("A")

    elif 65<=(m+f)<80:
        print("B")

    elif 50<=(m+f)<65 :
        print("C")

    elif 30 <= (m + f)<50:
        if r>=50:
            print("C")
        else:
            print("D")


    elif (m+f)<30 or m == -1 or f ==-1:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r =[int(i) for i in input().split()]

    if m == f == r ==-1:
        break

    if (m+f) >=80:
        print("A")

    if 65<=(m+f)<80:
        print("B")

    if 50<=(m+f)<65 :
        print("C")

    if 30 <= (m + f)<50:
        if r>=50:
            print("C")
        else:
            print("D")

    if (m+f)<30 or m == -1 or f == -1:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print("F")

    elif total <= 80:
        print("A")

    elif 65 <= total < 80:
        print("B")

    elif 50 <= total < 65:
        print("C")

    elif 30 <= total < 50 and r < 50:
        print("D")
        
    print()

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print("F")

    elif total <= 80:
        print("A")

    elif 65 <= total < 80:
        print("B")

    elif 50 <= total < 65:
        print("C")

    elif 30 <= total < 50 and r < 50:
        print("D")

    else:
        print()
    print()

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

total = m + f
if m == -1 or f == -1 or total < 30:
    print("F")

elif total < 50 and r < 50:
    print("D")

elif total < 65:
    print("C")

elif total < 80:
    print("B")
else:
    print("A")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

total = m + f
if m == -1 or f == -1 or total < 30:
    print('F')

elif total < 50 and r < 50:
    print('D')

elif total < 65:
    print('C')

elif total < 80:
    print('B')
else:
    print('A')

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print("F")

    elif 65 <= total or total < 80:
        print("B")

    elif 50 <= total or total < 65:
        print("C")

    elif 30 <= total or total < 50 and r < 50:
        print("D")

    else:
        print("A")

    print()

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print("F")

    elif 65 <= total or total < 80:
        print("B")

    elif 50 <= total or total < 65:
        print("C")

    elif 30 <= total or total < 50 and r < 50:
        print("D")

    else:
        print("A")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    total = m + f
    
    if m == f == r == -1:
        break
        
    elif m == -1 or f == -1 or total < 30:
        print("F")

    elif 65 <= total or total < 80:
        print("B")

    elif 50 <= total or total < 65:
        print("C")

    elif 30 <= total or total < 50 and r < 50:
        print("D")

    else:
        print("A")

    print()

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    total = m + f

    if m == -1 or f == -1 or total < 30:
        print("F")
    
    elif total < 80:
        print("B")
        
    elif total < 65 or r >= 50:
        print("C")
        
    elif total < 50 and r < 50:
        print("D")
        
    else:
        print("A")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

total = m+f

if total > 80:
    print("A")

elif 65 <= total and total < 80:
    print("B")

elif (50 <= total and total < 65) or (30 <= total and total < 50 and 50 <= f):
    print("C")

elif 30 <= total and total < 50:
    print("D")
 
elif total < 30 or m == -1 or f == -1:
    print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = map(int, input().split())
    if m == f == r == -1:
        break
    if m == -1 or f == -1:
        print('F')
    if m + f >= 80:
        print('A')
    if 65 <= m + f < 80:
        print('B')
    if 50 <= m + f < 65:
        print('C')
    if 30 <= m + f < 50:
        if r >= 50:
            print('C')
        else:
            print('D')
    if m + f < 30:
        print('F')

Submission status: Wrong Answer

Solution code:
while True:
    L = raw_input().split()
    m = int(L[0])
    f = int(L[1])
    r = int(L[2])
    if m * f * r == -1: break
    x = m + f

    if m * f < 0 or x < 30: print "F"
    
    elif x < 50:
        if r < 50: print "D"
        else: print "C"
        
    elif x < 65: print "C"

    elif x < 80: print "B"

    else: print "A"

Submission status: Wrong Answer

Solution code:
while True:
    L = raw_input().split()
    m = int(L[0])
    f = int(L[1])
    r = int(L[2])
    if m * f * r == -1: break
    x = m + f

    if m * f < 0: print "F"
    if x < 30: print "F"
    
    elif x < 50:
        if r < 50: print "D"
        else: print "C"
        
    elif x < 65: print "C"

    elif x < 80: print "B"

    else: print "A"

Submission status: Wrong Answer

Solution code:
while True:
    a = input().split(' ')
    if a[0] == '-1' and a[1] == '-1' and a[2] == '-1':
        break
    elif int(a[0]) + int(a[1]) >= 80:
        print('A')
    elif 65 <= int(a[0]) + int(a[1]) < 80:
        print('B')
    elif 50 <= int(a[0]) + int(a[1]) < 65:
        print('C')
    elif 30 <= int(a[0]) + int(a[1]) < 50:
        if int(a[2]) >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Wrong Answer

Solution code:
while True:
    a = input().split(' ')
    if a[0] == '-1' and a[1] == '-1' and a[2] == '-1':
        break
    elif int(a[0]) or int(a[1]) == -1:
        print('F')
    elif int(a[0]) + int(a[1]) >= 80:
        print('A')
    elif 65 <= int(a[0]) + int(a[1]) < 80:
        print('B')
    elif 50 <= int(a[0]) + int(a[1]) < 65:
        print('C')
    elif 30 <= int(a[0]) + int(a[1]) < 50:
        if int(a[2]) >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Wrong Answer

Solution code:
while True:
    L = raw_input().split()
    m = int(L[0])
    f = int(L[1])
    r = int(L[2])
    if m * f * r == -1: break
    x = m + f

    if m == -1 or f == -1 or x < 30: print "F"
    
    elif x < 50:
        if r < 50: print "D"
        else: print "C"
        
    elif x < 65: print "C"

    elif x < 80: print "B"

    else: print "A"

Submission status: Wrong Answer

Solution code:
MFR = input().split()
m = int(MFR[0])
f = int(MFR[1])
r = int(MFR[2])

while m!=-1 or f!=-1 or r!=-1:
    if 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")
    MFR = input().split()
    m = int(MFR[0])
    f = int(MFR[1])
    r = int(MFR[2])

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    if m==-1 or f==-1:
        print('F')
    elif m+f>=80:
        print('A')
    elif 65<=m+f<80:
        print('B')
    elif 50<=m+f<65:
        print('C')
    elif 30<=m+r<50:
        if r>=50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
	lis = []
	while True:
		mid, final, re = map( int, input().split() )
		if mid == final == re == -1:
			break
		lis.append([mid,final,re])
	for i in lis:
		if i[0]+i[1] >= 80:
			print("A")
		elif i[0]+i[1] >= 65:
			print("B")
		elif i[0]+i[1] >= 50:
			print("C")
		elif i[0]+i[1] >= 30:
			if i[2] >= 50:
				print("C")
			else:
				print("D")
		else:
			print("F")

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
	lis = []
	while True:
		mid, final, re = map( int, input().split() )
		if mid == final == re == -1:
			break
		lis.append([mid,final,re])
	for i in lis:
		if i[0] == -1 or i[1] == -1:
			print("F")
		if i[0]+i[1] >= 80:
			print("A")
		elif i[0]+i[1] >= 65:
			print("B")
		elif i[0]+i[1] >= 50:
			print("C")
		elif i[0]+i[1] >= 30:
			if i[2] >= 50:
				print("C")
			else:
				print("D")
		else:
			print("F")

Submission status: Wrong Answer

Solution code:
def get_score(medium, final, retry):
    medium_final = medium + final
    if 80 <= medium_final:
        return 'A'
    elif 65 <= medium_final:
        return 'B'
    elif 50 <= medium_final:
        return 'C'
    elif 30 <= medium_final:
        if 50 <= retry:
            return 'C'
        else:
            return 'D'
    else:
        return 'F'


while True:
    [medium, final, retry] = [int(x) for x in raw_input().split()]
    if [medium, final, retry] == [-1, -1, -1]:
        break

    print(get_score(medium, final, retry))

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = map(int, input().split())
    if (m, f, r) == (-1, -1, -1):
        break
    if m+f >= 80:
        print("A")
    elif m+f >= 65 and m+f < 80:
        print("B")
    elif m+f >= 50 and m+f < 65:
        print("C")
    elif m+f >= 30 and m+f < 50:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    s = m + f
    if s >= 80:
        print("A")
    elif s >= 65:
        print("B")
    elif s >= 50:
        print("C")
    elif s >=30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    s = (m if m > 0 else 0) + (f if f > 0 else 0)
    if s >= 80:
        print("A")
    elif s >= 65:
        print("B")
    elif s >= 50:
        print("C")
    elif s >=30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = list(map(int,input().split()))
    if (m == -1) & (f == -1) & (r == -1):
        break
    if (m + f) < 30:
        print("F")
    elif (m + f) < 50 & r < 50:
        print("D")
    elif (m + f) < 65:
        print("C")
    elif (m + f) < 80:
        print("B")
    else:
        print("A")

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = list(map(int,input().split()))
    if (m == -1) & (f == -1) & (r == -1):
        break
    if (m + f) < 30 | m == -1 | f == -1:
        print("F")
    elif (m + f) < 50 & r < 50:
        print("D")
    elif (m + f) < 65:
        print("C")
    elif (m + f) < 80:
        print("B")
    else:
        print("A")

Submission status: Wrong Answer

Solution code:
m,f,r = 0,0,0
while True:
    m,f,r = [int(i) for i in input().split()]
    if m+f+r == -3:
        break
    elif -1 in {m,f}:
        print("F")
    elif 80 <= m+f:
        print("A")
    elif 65 <= m+f <= 80:
        print("B")
    elif 50 <= m+f <= 65:
        print("C")
    elif 30 <= m+f <= 50:
        if 50 <= r:
            print("C") 
        print("D")
    elif m+f <= 30:
        print("F")

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-
while True:
    m,f,r = map(int,input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        print('F')
    if m + f >= 80:
        print('A')
    if 80 > m + f and m + f >= 65:
        print('B')
    if 65 > m + f and m + f >= 50:
        print('C')
    if 50 > m + f and m + f >= 30:
        if r >= 50:
            print('C')
        else:
            print('D')
    if 30 >= m + f:
        print('F')

Submission status: Wrong Answer

Solution code:
score = []

while True:
    m, f, r = [int(i) for i in input().split()]
    if m == -1 and f == -1 and r == -1:
        break
    score.append([[m],[f],[r]])

for i in range(len(score)):
    if score[i][0][0] + score[i][1][0] >= 80:
       print('A')
    elif score[i][0][0] + score[i][1][0] >= 65:
        print('B')
    elif score[i][0][0] + score[i][1][0] >= 50:
        print('C')
    elif score[i][0][0] + score[i][1][0] >= 80:
        print('C') if score[i][2][0] >= 50 else print('D')
    else:
        print('F')