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: Accepted

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 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: Accepted

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")

Submission status: Accepted

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: Accepted

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: Accepted

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: Accepted

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 r >= 50 or total < 65:
      print("C")
   
   elif total < 80:
      print("B")

   else:
      print("A")

Submission status: Accepted

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: Accepted

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: Accepted

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 or r >= 50:
        print('C')
        
    elif total < 80:
        print('B')

    else:
        print('A')

Submission status: Accepted

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: Accepted

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: Accepted

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: Accepted

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 r >= 50 or total < 65:
      print("C")
    
   elif total < 80:
      print("B")
 
   else:
      print("A")

Submission status: Accepted

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: Accepted

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 r >= 50 or total < 65:
      print("C")
    
   elif total < 80:
      print("B")
 
   else:
      print("A")

Submission status: Accepted

Solution code:
date=[[],[],[]]
a,b,c=0,0,0
while True:
   if a < 0 and b < 0 and c < 0:
      break
   else:
      a,b,c =[int(i) for i in input().split()]
      date[0].append(a)
      date[1].append(b)
      date[2].append(c)
for h in range(0,len(date[0])-1):
   if date[0][h] == -1 or date[1][h] == -1:
      print("F")
   elif date[0][h] == date[1][h] == date[2][h]:
      break
   else:
      if date[0][h] + date[1][h] >= 80:
         print("A")
      else:
         if date[0][h] + date[1][h] >= 65:
            print("B")
         else:
            if date[0][h] + date[1][h] >= 50:
               print("C")
            else:
               if date[0][h] + date[1][h] >=30:
                  if date[2][h] >= 50:
                     print("C")
                  else:
                     print("D")
               else:
                  print("F")

Submission status: Accepted

Solution code:
while True:
    m, f, r = [int(i) for i in input().split()]
    if m == f == -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 and r >= 50:
        print('C')
    elif 30 <= m + f < 50:
        print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
grade=[]
while True:
    score=[m,f,r]=[int(x) for x in input().split()]
    if [m,f,r]==[-1,-1,-1]:
        break
    elif -1 in [m,f]:
        print("F")
    elif 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("C")
    elif 50>=m+f>=30 and r<50:
        print("D")
    else:
        print("F")

Submission status: Accepted

Solution code:
import sys

for i in sys.stdin.readlines():
    m, f, r = [int(x) for x in i.split()]
    if m == f == r == -1:
        break
    elif (m == -1 or f == -1) or (m + f < 30):
        print('F')
    elif m + f >= 80:
        print('A')
    elif m + f >= 65:
        print('B')
    elif m + f >= 50 or (30 <= m + f <= 50 and r >= 50):
        print('C')
    elif m + f >= 30:
        print('D')

Submission status: Accepted

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')
        continue
    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: Accepted

Solution code:
while True:
    a = input().split(' ')
    if a[0] == '-1' and a[1] == '-1' and a[2] == '-1':
        break
    elif int(a[0]) == -1 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: Accepted

Solution code:
while True:
    L = raw_input().split()
    m = int(L[0])
    f = int(L[1])
    r = int(L[2])
    if m == -1 and f == -1 and 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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def judge(m, f, r):
	if m==-1 or f==-1: return "F"
	
	ttl = m + f
	if ttl >= 80: return "A"
	elif ttl >= 65: return "B"
	elif ttl >= 50: return "C"
	elif ttl >= 30:
		return "C" if r>=50 else "D"
	else: return "F"

if __name__ == "__main__":
	while True:
		m, f, r = map(int, raw_input().split())
		if m==-1 and f==-1 and r==-1: break
		print judge(m, f, r)

Submission status: Accepted

Solution code:
# ????????????????????°??????
import sys

def main():
    while True:
        m, f, r = [int(i) for i in sys.stdin.readline().strip().split(' ')]
        if m == -1 and f == -1 and r == -1:
            break

        sum = m + f
        
        if m == -1 or f == -1:
            rank = 'F'
        elif sum >= 80:
            rank = 'A'
        elif sum >= 65:
            rank = 'B'
        elif sum >= 50:
            rank = 'C'
        elif sum >= 30:
            if r >= 50:
                rank = 'C'
            else:
                rank = 'D'
        else:
            rank = 'F'

        print(rank)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a = []
while True:
    d = list(map(int,input().split()))
    if d == [-1,-1,-1]:
        break
    a.append(d)

def Point2Grade(d):
    m,f,r = d
    if (m==-1)|(f==-1):
        return 'F'
    elif m+f >= 80:
        return 'A'
    elif m+f >= 65:
        return 'B'
    elif m+f >= 50:
        return 'C'
    elif m+f >= 30:
        if r >=50: return 'C'
        else: return 'D'
    else: return 'F'

for x in a:
    print(Point2Grade(x))

Submission status: Accepted

Solution code:
def judge(m, f, r):
    p = m + f
    if (m == -1 or f == -1 or p < 30):
        a = 'F'
    elif (p >= 80):
        a = 'A'
    elif (p >= 65 and p < 80):
        a = 'B'
    elif (p >= 50 and p < 65 or r >= 50):
        a = 'C'
    elif (p >= 30 and p < 50):
        a = 'D'
    return a

while True:
    m, f, r = map(int, input().split())
    if (m == -1 and f == -1 and r == -1):
        break
    print(judge(m, f, r))

Submission status: Accepted

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+f<50:
        if r>=50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    r = list(map(int, input().split()))

    if r[0] == -1 and r[1] == -1 and r[2] == -1:
        break
    elif r[0] == -1 or r[1] == -1:
        print("F")
    elif r[0] + r[1] >= 80:
        print("A")
    elif r[0] + r[1] >= 65 and r[0] + r[1] < 80:
        print("B")
    elif r[0] + r[1] >= 50 and r[0] + r[1] < 65:
        print("C")
    elif r[0] + r[1] >= 30 and r[0] + r[1] < 50:
        if r[2] >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

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

Submission status: Accepted

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 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: Accepted

Solution code:
def grade(m, f, r):
    if m == -1 or f == -1:
        return 'F'
    s = m + f
    if s >= 80:
        return 'A'
    if s >= 65:
        return 'B'
    if s >= 50:
        return 'C'
    if s >= 30:
        if r >= 50:
            return 'C'
        else:
            return 'D'
    return 'F'

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def get_score(medium, final, retry):
    medium_final = medium + final
    if medium == -1 or final == -1:
        return 'F'
    elif 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: Accepted

Solution code:
def get_score(medium, final, retry):
    medium_final = medium + final
    if medium == -1 or final == -1:
        return 'F'
    elif 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'


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

for n in data:
    print(n)

Submission status: Accepted

Solution code:
while True:
    m, f, r = [int (x) for x in input().split(' ')]
    if m == -1 and f == -1 and r == -1: break
    if m == -1 or f == -1 or m + f < 30:
        print('F')
    elif 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')

Submission status: Accepted

Solution code:
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 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: Accepted

Solution code:
if __name__ == '__main__':
    # ?????°??????????????\???
    scores = []
    while True:
        score = [int(x) for x in input().split(' ')]
        if score[0] == -1 and score[1] == -1 and score[2] == -1:
            break
        scores.append(score)

    # ?????°??????????????????????????????
    for s in scores:
        midterm_exam = s[0]
        final_exam = s[1]
        re_exam = s[2]
        if midterm_exam == -1 or final_exam == -1:
            grade = 'F'
        elif midterm_exam + final_exam >=80:
            grade = 'A'
        elif midterm_exam + final_exam >= 65:
            grade = 'B'
        elif midterm_exam + final_exam >= 50:
            grade = 'C'
        elif midterm_exam + final_exam < 30:
            grade = 'F'
        elif re_exam >= 50:
            grade = 'C'
        else:
            grade = 'D'
        print(grade)

Submission status: Accepted

Solution code:
def get_perfomance(score):
    m, f, r = score
    sum_mf = m + f
    if 0 > m or 0 > f:
        return 'F'
    elif 80 <= sum_mf:
        return 'A'
    elif 65 <= sum_mf:
        return 'B'
    elif 50 <= sum_mf:
        return 'C'
    elif 30 <= sum_mf:
        if 50 <= r:
            return 'C'
        else:
            return 'D'
    else:
        return 'F'

if __name__ == '__main__':
    score_list = []
    while True:
        values = [int(x) for x in input().split()]
        if 3 == values.count(-1):
            break
        score_list.append(values)

    for score in score_list:
        print(get_perfomance(score))

Submission status: Accepted

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")
        continue
    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: Accepted

Solution code:
while(True):
	m,f,r=list(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 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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m,f,r = map(int,input().split())
score = 0

while m!=-1 or f!=-1 or r!= -1:
    score = m+f
    if m==-1 or f ==-1:
        grade = "F"
    elif score >= 80:
        grade = "A"
    elif score < 80 and score >= 65:
        grade = "B"
    elif score < 65 and score >= 50:
        grade = "C"
    elif score < 50 and score >= 30:
        if r>=50:
            grade = "C"
        else:
            grade = "D"
    else:
        grade = "F"

    print(grade)
    m,f,r = map(int,input().split())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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") 
        else:
            print("D")
    elif m+f <= 30:
        print("F")

Submission status: Accepted

Solution code:
while(True):
    m, f, r = map(int, input().split(" "))

    if (m == -1) and (f == -1) and (r == -1):
        exit()

    if (m == -1) or (f == -1):
        print("F")
    elif (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: Accepted

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

print('\n'.join(score))

Submission status: Accepted

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')
        m = -999
    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 >= 0:
        print('F')

Submission status: Accepted

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] == -1 or score[i][1][0] == -1:
        print('F')
    elif 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] >= 30:
        print('C') if score[i][2][0] >= 50 else print('D')
    else:
        print('F')