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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
while True:
 m,f,r = map(int, raw_input().split())
 m+f = s
 if m==-1 and f==-1 and r ==-1 : break
 elif m==-1 or f==-1 or r<30 : g=4
 elif 30 <= s and s <50 :
      if r <= 50: g=2
      else g=3
 elif 50 <=s and s <65 : g=2
 elif 65 <=s and s<70 : g=1
 else: g=0
 print 'ABCDF'[g]

Submission status: Runtime Error

Solution code:
while True:
 m,f,r = map(int, raw_input().split())
 m+f = s
 if m==-1 and f==-1 and r ==-1 : break
 elif m==-1 or f==-1 or r<30 : g=4
 elif 30 <= s and s <50 :
      if r <= 50: g=2
      else : g=3
 elif 50 <=s and s <65 : g=2
 elif 65 <=s and s<70 : g=1
 else: g=0
 print 'ABCDF'[g]

Submission status: Runtime Error

Solution code:
while True:
       m,f,r = map(int, raw_input().split())
       m+f = s
      if m==-1 and f==-1 and r ==-1 : break
      elif m==-1 or f==-1 or r<30 : g=4
      elif 30 <= s and s <50 :
           if r <= 50: g=2
           else : g=3
      elif 50 <=s and s <65 : g=2
      elif 65 <=s and s<70 : g=1
      else: g=0
      print 'ABCDF'[g]

Submission status: Runtime Error

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 (m+f) <=65:
        print(B)
    elif (m+f) <=50:
        print(C)
    elif( m+f)<=30 and r <=50:
        print(C)
    elif ( m+f)<=30:
        print(D)
    else :
        print(F)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
while 1:
    m, f, r = raw_input().split()
    sum = m + f
    if sum == -2: break
    elif min(m, f) == -1: print 'F'
    elif sum > 80: print 'A'
    elif sum > 65: print 'B'
    elif sum > 50: print 'C'
    elif sum > 30:
        if r > 50: print 'C'
        else: print 'D'
    else: print 'F'

Submission status: Runtime Error

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

Submission status: WA: Presentation Error

Solution code:
midScore =[0]*50
finScore = [0]*50
reScore = [0]*50
personNum = 0
while True:
    m,f,r = map(int,input().split())
    midScore[personNum] = m
    finScore[personNum] = f
    reScore[personNum] = r
    personNum += 1
    if m is f is r is -1:
        break
    
    
for person in range(personNum):
    totalScore = midScore[person] + finScore[person]
    if midScore[person] is finScore[person] is reScore[person] is -1:
        print("")
    elif midScore[person] == -1 or finScore[person] == -1:
        print("F")
    elif 80<=totalScore:
        print("A")
    elif 65<=totalScore<80:
        print("B")
    elif 50<=totalScore<65:
        print("C")
    elif 30<=totalScore<50:
        if 50<=reScore:
            print("C")
        else:
            print("D")
    elif totalScore<30:
        print("F")

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

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

    if (m == -1 or f == -1) or (m + f < 30):
        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")
            
    print()

Submission status: WA: Presentation Error

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

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

    if (m == -1 or f == -1) or (m + f < 30):
        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")
            
print()

Submission status: WA: Presentation Error

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

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

    if (m == -1 or f == -1) or (m + f < 30):
        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")
print()

Submission status: WA: Presentation Error

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 < 80:
        print("B")

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

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

    print()

Submission status: WA: Presentation Error

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