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:
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) and (m+f<80) :
   print('B')

 if (50<= m+f) and (m+f<60):
   print('C')

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

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

Submission status: Wrong Answer

Solution code:
while True:
 m,f,r=map(int,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) and (m+f<80) :
   print('B')

 elif (50<= m+f) and (m+f<60):
   print('C')

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

 elif(m+f<30):
   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')

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

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

 elif 50<= (m+f) and (m+f)<60 :
   print('C')

 elif 30<=(m+f) and (m+f)<50 :
   if 50<=r :
    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

    mf = m + f

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

    elif mf < 50 and r <= 50:
        print('D')

    elif mf >= 50 and mf < 65:
        print('C')

    elif mf >= 65 and mf < 80:
        print('B')

    elif mf >= 80:
        print('A')

Submission status: Wrong Answer

Solution code:
#coding:utf-8
#1_7_A 2015.4.5
while True:
    m,f,r = map(int,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 or f) == -1 or m + f < 30:
        print('F')

Submission status: Wrong Answer

Solution code:
#coding:utf-8
#1_7_A 2015.4.5
while True:
    m,f,r = map(int,input().split())
    if m == f == r == -1:
        break
    elif (m or f) == -1 or m + f < 30:
        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')

Submission status: Wrong Answer

Solution code:
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	sum=data[0]+data[1]
	if sum<30:
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

Solution code:
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	sum=data[0]+data[1]
	
	if sum<30 or(data[0]==data[2]==-1 or data[1]==data[2]==-1):
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

Solution code:
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	if data[0]==-1:
		data[0]=data[2]
	elif data[1]==-1:
		data[1]=data[2]
	sum=data[0]+data[1]
	if sum<30 or(data[0]==-1 or data[1]==-1):
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<=79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

Solution code:
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	
	if data[0]!=-1 and data[1]!=-1:
		sum=data[0]+data[1]
	elif data[0]!=-1 or data[1]!=-1:
		sum=data[0]+data[1]+1
	if data[2]!=-1:
		sum=data[2]
	print(sum)
	
	if sum<30 :
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<=79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

Solution code:
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	
	if data[0]!=-1 and data[1]!=-1:
		sum=data[0]+data[1]
	elif data[0]!=-1 or data[1]!=-1:
		sum=data[0]+data[1]+1
	if data[2]!=-1:
		sum=data[2]
	
	
	if sum<30 :
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<=79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

Solution code:
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	
	if data[0]!=-1 and data[1]!=-1:
		sum=data[0]+data[1]
	elif data[0]!=-1 or data[1]!=-1:
		sum=data[0]+data[1]+1
	if data[2]!=-1:
		sum=data[2]
	
	
	if data[0]==-1 or data[1]==-1:
		print('F')
	elif sum<30 :
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<=79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

Solution code:
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	
	if data[0]!=-1 and data[1]!=-1:
		sum=data[0]+data[1]
	if data[2]!=-1 and sum<data[2]:
		sum=data[2]
	
	
	if data[0]==-1 or data[1]==-1:
		print('F')
	elif sum<30 :
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<=79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

Solution code:
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	sum=0
	if data[0]!=-1 and data[1]!=-1:
		sum=data[0]+data[1]
	if data[2]!=-1 and sum<data[2]:
		sum=data[2]
	
	
	if data[0]==-1 or data[1]==-1:
		print('F')
	elif sum<30 :
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<=79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

Solution code:
import sys
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	
	if data[0]!=-1 and data[1]!=-1:
		sum=data[0]+data[1]
	if data[2]!=-1 and sum<data[2]:
		sum=data[2]
		if sum>50:
			sum=50
	
	if data[0]==-1 or data[1]==-1:
		print('F')
	elif sum<30 :
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<=79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

Solution code:
import sys
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	
	if data[0]!=-1 and data[1]!=-1:
		sum=data[0]+data[1]
	if data[2]!=-1 and sum<data[2]:
		sum=data[2]
		if sum>=50:
			sum=50
		elif sum<50:
			sum=0
	if data[0]==-1 or data[1]==-1:
		print('F')
	elif sum<30 :
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<=79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

Solution code:
import sys
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	
	if data[0]!=-1 and data[1]!=-1:
		sum=data[0]+data[1]
	if data[2]!=-1 :
		sum=data[2]
		if sum>=50:
			sum=50
		elif sum<50:
			sum=0
	if data[0]==-1 or data[1]==-1:
		print('F')
	elif sum<30 :
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<=79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

Solution code:
import sys
while True:
	data=list(map(int,input().split()))
	if data[0]==data[1]==data[2]==-1: break
	
	if data[0]!=-1 and data[1]!=-1:
		sum=data[0]+data[1]
	if data[2]!=-1 and sum<data[2]:
		sum=data[2]
		if sum>=50:
			sum=50
		
	if data[0]==-1 or data[1]==-1:
		print('F')
	elif sum<30 :
		print('F')
	elif 30<=sum<50:
		print('D')
	elif 50<=sum<65:
		print('C')
	elif 65<=sum<=79:
		print('B')
	elif 80<=sum:
		print('A')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while True:
    line = raw_input()
    if line == '-1 -1 -1':
        break
    middle, final, re = map(int, line.split())
    if middle == -1 or final == -1:
        grade = 'F'
    elif middle + final >= 80:
        grade = 'A'
    elif 65 <= middle + final < 80:
        grade = 'B'
    elif 50 <= middle + final < 65:
        grade = 'C'
    elif 30 <= middle + final < 50:
        if 50 <= re:
            grade = 'C'
        grade = 'D'
    elif middle + final < 30:
        grade = 'F'
    print grade

Submission status: Wrong Answer

Solution code:
while 1:
    m, f, r = map(int, input().split())
    if m == f == 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 + f < 50 or 50 <= r:
        print('D')
    else:
        print('F')

Submission status: Wrong Answer

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

    if ((m == -1 or f == -1) or (s < 30)):
        R = "F"

    if 80 <= s:
        R = "A"


    if (65 < s <= 80):
        R = "B"

    if (50 < s <= 65) or (r <= 50):
        R = "C"

    if (30 < s <= 50):
        R = "D"

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

    print(R)

Submission status: Wrong Answer

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

    s = m + f

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

    if 80 <= s:
        print('A')


    if 65 < s:
        print('B')

    if (50 < s) or (r <= 50):
        print('C')

    if 30 < s:
        print('D')

Submission status: Wrong Answer

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

    s = m + f

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

    elif 80 <= s:
        print('A')


    elif 65 < s:
        print('B')

    elif (50 < s) or (r <= 50):
        print('C')

    elif 30 < s:
        print('D')

Submission status: Wrong Answer

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

    s = m + f

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

    elif 80 < s:
        print('A')


    elif 65 < s:
        print('B')

    elif 50 < s or 50 < r:
        print('C')

    elif 30 < s:
        print('D')

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 < 85:
        print('B')
    else:
        print('A')

Submission status: Wrong Answer

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

    total = m + f
    if total >= 80:
        print('A')
    elif total >= 65:
        print('B')
    elif total >= 50 or r >= 50:
        print('C')
    elif total >= 30:
        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

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

    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
    mf = abs(m*f)

    if mf<30 : print("F")
    elif mf<50 and r<50 : print("D")
    elif mf<65 : print("C")
    elif mf<80 : print("B")
    elif mf>=80 : print("A")

    else: print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = [int(i) for i in input().strip().split()]
    if m==f==r==-1 : break
    if m*f<0 and (m or b)<30 : print("F")

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

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = [int(i) for i in input().strip().split()]
    if m==f==r==-1 : break
    if m*f<0 and 0<=(m or b)<30 : print("F")

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

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = [int(i) for i in input().strip().split()]
    if m==f==r==-1 : break
    if m*f<0 and 0<=(m or f)<30 : print("F")

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
midExam, finalExam, reExam = list(map(int, input().split()))
addedResult = midExam + finalExam

while midExam != -1 and finalExam != -1 :
    if midExam == -1 or finalExam == -1 or addedResult < 30 :
        print("F")
    elif addedResult >= 80 :
        print("A")
    elif addedResult >= 65 and addedResult < 80 :
        print("B")
    elif addedResult >= 50 and addedResult < 65 :
        print("C")
    elif addedResult >= 30 and addedResult < 50 :
        if reExam >= 50 :
            print("C")
        else :
            print("D")
    midExam, finalExam, reExam = list(map(int, input().split()))
    addedResult = midExam + finalExam

Submission status: Wrong Answer

Solution code:
import sys

for i in sys.stdin:
    scores = list(map(int, i.split()))
    m = scores[0]
    f = scores[1]
    r = scores[2]
    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")
    else:
        print("F")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = map(int,raw_input().split())
    if m==-1 and f==-1 and r==-1:
        break
    mfsum = m+f
    if mfsum >=80:
        print "A"
    elif mfsum >= 65 and mfsum <80:
        print "B"
    elif mfsum >= 50 and mfsum < 65:
        print "C"
    elif mfsum >=30 and mfsum < 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 = sum(filter(lambda x: x != -1, [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
    if m == -1 or f == -1:
        print('F')
    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, v = [int(n) for n in input().split()]

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
num = []
while True:
    m,f,r = map(int, raw_input().split())
    ans = m + f
    if m == f == r == -1:
        break

    if ans >= 80:
        num.append("A")
    elif (65 <= ans) and (ans < 80):
        num.append("B")
    elif (50 <= ans) and (ans < 65):
        num.append("C")
    elif (30 <= ans) and (ans < 50):
        if r >= 50:
            num.append("C")
    else:
        num.append("F")

for i in range(len(num)):
    print num[i]

Submission status: Wrong Answer

Solution code:
num = []
while True:
    m,f,r = map(int, raw_input().split())

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

    if m == -1: 
        m = 0
    if f == -1:
        f = 0

    if ans >= 80:
        num.append("A")
    elif (65 <= ans) and (ans < 80):
        num.append("B")
    elif (50 <= ans) and (ans < 65):
        num.append("C")
    elif (30 <= ans) and (ans < 50):
        if r >= 50:
            num.append("C")
    else:
        num.append("F")

for i in range(len(num)):
    print num[i]

Submission status: Wrong Answer

Solution code:
num = []
while True:
    m,f,r = map(int, raw_input().split())

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

    if m == -1: 
        m = 0
    if f == -1:
        f = 0

    if ans >= 80:
        num.append("A")
    elif (65 <= ans) and (ans < 80):
        num.append("B")
    elif (50 <= ans) and (ans < 65):
        num.append("C")
    elif (30 <= ans) and (ans < 50):
        if r >= 50:
            num.append("C")
        else:
            num.append("F")
    else:
        num.append("F")

for i in range(len(num)):
    print num[i]

Submission status: Wrong Answer

Solution code:
num = []
while True:
    l = map(int, raw_input().split())
    if l[0] == l[1] == l[2] == -1:
        break
    sum = l[0] + l[1]
    if sum >= 80:
        num.append("A")
    elif sum >= 65:
        num.append("B")
    elif sum >= 50:
        num.append("C")
    elif sum >= 30:
        if l[2] >= 50:
            num.append("C")
        else:
            num.append("D")
    else:
        num.append("F")

for i in range(len(num)):
    print num[i]

Submission status: Wrong Answer

Solution code:
import sys

a = sys.stdin.readlines()
for i in range(len(a)):
	b = a[i].split()
	m =int(b[0])
	f =int(b[1])
	r =int(b[2])
	if m*f < 0 and r!=-1:
		print "F"
	elif m==-1 and f==-1 and r==-1:
		break
	else:
		if m+f >= 80:
			print "A"
		elif 80 > m+f >=65:
			print "B"
		elif 65 > m+f >=50:
			print "C"
		elif 50 > m+f >=30 and r < 50:
			print "D"
		elif 50 > m+f >=30 and r >= 50:	
			print "C"
		elif 30 > m+f:
			print "F"

Submission status: Wrong Answer

Solution code:
A=[]
while True:
	#midterm exam score(50) : m
	#final  exam score(50)  : f
	#retest score(100)      : r
	m,f,r = [int(i) for i in input().split()]
	if m == f == r == -1:
		break
	elif m+f >= 80:
		A.append('A')
	elif 65<=m+f<80:
		A.append('B')
	elif 50<=m+f<65:
		A.append('C')
	elif (30<=m+f<50) and (50<=r):
		A.append('D')
	else:
		A.append('F')

for i in range(len(A)):
	print(A[i])

Submission status: Wrong Answer

Solution code:
A=[]
while True:
	#midterm exam score(50) : m
	#final  exam score(50)  : f
	#retest score(100)      : r
	m,f,r = [int(i) for i in input().split()]
	if m == f == r == -1:
		break
	elif m+f >= 80:
		A.append('A')
	elif 65<=m+f<80:
		A.append('B')
	elif (50<=m+f<65) or ((30<=m+f<50) and (50<=r)):
		A.append('C')
	elif (30<=m+f<50):
		A.append('D')
	else:
		A.append('F')

for i in range(len(A)):
	print(A[i])

Submission status: Wrong Answer

Solution code:
A=[]
while True:
	#midterm exam score(50) : m
	#final  exam score(50)  : f
	#retest score(100)      : r
	m,f,r = [int(i) for i in input().split()]
	if m == f == r == -1:
		break
	if m == -1:
		m = 1
	if f == -1:
		f = 1
	elif m+f >= 80:
		A.append('A')
	elif 65<=m+f<80:
		A.append('B')
	elif (50<=m+f<65) or ((30<=m+f<50) and (50<=r)):
		A.append('C')
	elif (30<=m+f<50):
		A.append('D')
	else:
		A.append('F')

for i in range(len(A)):
	print(A[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = map(int, raw_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 65<=m+f<80:
        print 'B'
    elif 50<=m+f<65:
        print 'C'
    elif 30<=m+f<50:
        if r==-1:
            print 'D'
        elif r>=50:
            print 'C'
    else:
        print 'F'

Submission status: Wrong Answer

Solution code:
while True:
    m, f, r = map(int, raw_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 65<=m+f<80:
        print 'B'
    elif 50<=m+f<65:
        print 'C'
    elif 30<=m+f<50:
        if r==-1:
            print 'D'
        elif r>=50:
            print 'C'
    elif 0<=m+f<30:
        print 'F'

Submission status: Wrong Answer

Solution code:

a = []
while True:
    n = map(int, raw_input().split())
    if n == [-1, -1, -1]:
        break
    a.append(n)

for n in range(len(a)):
    m = a[n][0] + a[n][1] 
    if a[n][0] == -1 or a[n][1] == -1: print "F"
    if m  >= 80: print "A"
    if m >= 65 and m < 80: print "B"
    if m >= 50 and m < 65: print "C"
    if m >= 30 and m < 50: print "D"
    if m >= 30 and m < 50 and a[n][2] >= 50: print "C"
    if m < 30: print "F"

Submission status: Wrong Answer

Solution code:

a = []
while True:
    n = map(int, raw_input().split())
    if n == [-1, -1, -1]:
        break
    a.append(n)

for n in range(len(a)):
    m = a[n][0] + a[n][1] 
    if a[n][0] == -1 or a[n][1] == -1: 
        print "F"
        break
    if m  >= 80: print "A"
    if m >= 65 and m < 80: print "B"
    if m >= 50 and m < 65: print "C"
    if m >= 30 and m < 50: print "D"
    if m >= 30 and m < 50 and a[n][2] >= 50: print "C"
    if m < 30: print "F"

Submission status: Wrong Answer

Solution code:

a = []
while True:
    n = map(int, raw_input().split())
    if n == [-1, -1, -1]:
        break
    a.append(n)

for n in range(len(a)):
    m = a[n][0] + a[n][1] 
    if a[n][0] == -1 or a[n][1] == -1: 
        print "F"
        break
    if m >= 80: print "A"
    if m >= 65 and m < 80: print "B"
    if m >= 50 and m < 65: print "C"
    if m >= 30 and m < 50: 
        if a[n][2] >= 50: print "C"
        else: print "D"
    if m < 30: print "D"

Submission status: Wrong Answer

Solution code:

a = []
while True:
    n = map(int, raw_input().split())
    if n == [-1, -1, -1]:
        break
    a.append(n)

for n in range(len(a)):
    m = a[n][0] + a[n][1] 
    if a[n][0] == -1 or a[n][1] == -1: 
        print "F"
        break
    if m >= 80: print "A"
    if m >= 65 and m < 80: print "B"
    if m >= 50 and m < 65: print "C"
    if m >= 30 and m < 50: 
        if a[n][2] >= 50: print "C"
        else: print "D"
        break
    if m < 30: print "D"

Submission status: Wrong Answer

Solution code:

a = []
while True:
    n = map(int, raw_input().split())
    if n == [-1, -1, -1]:
        break
    a.append(n)

for n in range(len(a)):
    m = a[n][0] + a[n][1] 
    if a[n][0] == -1 or a[n][1] == -1: 
        print "F"
        break
    if m >= 80: print "A"
    if m >= 65 and m < 80: print "B"
    if m >= 50 and m < 65: print "C"
    if m >= 30 and m < 50: 
        if a[n][2] >= 50: print "C"
        else: print "D"
        break
    if m < 30: print "F"

Submission status: Wrong Answer

Solution code:

a = []
while True:
    n = map(int, raw_input().split())
    if n == [-1, -1, -1]:
        break
    a.append(n)

for n in range(len(a)):
    m = a[n][0] + a[n][1] 
    if a[n][0] == -1 or a[n][1] == -1: 
        print "F"
        break
    if m >= 80: print "A"
    if m >= 65 and m < 80: print "B"
    if m >= 50 and m < 65: print "C"
    if m >= 30 and m < 50: 
        if a[n][2] >= 50: print "C"
        elif a[n][2] < 50: print "D"
        break
    if m < 30: print "F"

Submission status: Wrong Answer

Solution code:

a = []
while True:
    n = map(int, raw_input().split())
    if n == [-1, -1, -1]:
        break
    a.append(n)

for n in range(len(a)):
    m = a[n][0] + a[n][1]
    if a[n][0] > 50 or a[n][1] > 50:
        print "F"
        break 
    if a[n][0] == -1 or a[n][1] == -1: 
        print "F"
        break
    if m >= 80: print "A"
    if m >= 65 and m < 80: print "B"
    if m >= 50 and m < 65: print "C"
    if m >= 30 and m < 50: 
        if a[n][2] >= 50: print "C"
        elif a[n][2] < 50: print "D"
        break
    if m < 30: print "F"

Submission status: Wrong Answer

Solution code:

a = []
while True:
    n = map(int, raw_input().split())
    if n == [-1, -1, -1]:
        break
    a.append(n)

for n in range(len(a)):
    m = a[n][0] + a[n][1]
    
    if a[n][0] == -1 or a[n][1] == -1: 
        print "F"
        break
    if m >= 80: print "A"
    if m >= 65 and m < 80: print "B"
    if m >= 50 and m < 65: print "C"
    if m >= 30 and m < 50: 
        if a[n][2] < 50: print "D"
        if a[n][2] >= 50: print "C"
        break
    if m < 30: print "F"

Submission status: Wrong Answer

Solution code:

a = []
while True:
    n = map(int, raw_input().split())
    if n == [-1, -1, -1]:
        break
    a.append(n)

for n in range(len(a)):
    m = a[n][0] + a[n][1]
    
    if a[n][0] == -1 or a[n][1] == -1: 
        print "F"
        break
    if m >= 80: print "A"
    if m >= 65 and m < 80: print "B"
    if m >= 50 and m < 65: print "C"
    if m >= 30 and m < 50: 
        if a[n][2] < 50: print "D"
        if a[n][2] >= 50: print "C"
    if m < 30: print "F"

Submission status: Wrong Answer

Solution code:
m, f, r = map(int, raw_input().split())

while m != -1 or f != -1 or r != -1:

	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"

	m, f, r = map(int, raw_input().split())

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"