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 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 80 > m+f >= 65:
        print("B")

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
while True:
    m,f,r=map(int,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 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 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 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')
    elif m + f < 30:
        print('F')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    m, f, r = map(int, input().split())
    if m < 0 and f < 0 and r < 0:
        break

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#1_7_A
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 < 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 True:
    m,f,r = map(int,input().split())
    
    
    point = 0
    if m == -1 and f == -1 and r == -1:
        break
    
    point += m + f
    
    if m == -1 or f == -1:
        print("F")
    elif point >= 80:
        print("A")
    elif 80 > point and point >= 65:
        print("B")
    elif 65 > point and point >=50:
        print("C")
    elif 50 > point and point >=30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Accepted

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

for i in grade:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main_v1():
    grade = ""
    while True:
        mid, final, re = map(int, input().split())
        if mid == -1 and final == -1 and re == -1:
            break
        if mid == -1 or final == -1:
            grade = "F"
        elif mid + final >= 80:
            grade = "A"
        elif mid + final >= 65:
            grade = "B"
        elif mid + final >= 50:
            grade = "C"
        elif mid + final >= 30:
            if re >= 50:
                grade = "C"
            else:
                grade = "D"
        else:
            grade = "F"
        print(grade)
    return 0

if __name__ == "__main__":
    main_v1()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Data = []

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

for a in Data:
    print(judge(a[0],a[1],a[2]))

Submission status: Accepted

Solution code:
from sys import stdin
input = stdin.readline

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:
while True:
  s = list(map(int,input().split()))
  if sum(s) == -3:
    break
  if s[0] == -1 or s[1] == -1:
    print('F')
    continue
  if (s[0] + s[1]) >= 80:
    print('A')
  elif (s[0] + s[1]) >= 65:
    print('B')
  elif (s[0] + s[1]) >= 50:
    print('C')
  elif (s[0] + s[1]) >= 30:
    if s[2] >= 50:
      print('C')
    else:
      print('D')
  else:
    print('F')

Submission status: Accepted

Solution code:
for i in range(1,51):
    m,f,r=map(int,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 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")
    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 :
        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: Accepted

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

Submission status: Accepted

Solution code:
def devide_grade(m,f,r):
    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")
        
c = 0

while c < 50 :
    c += 1
    m,f,r = map(int,input().split())
    if m == -1 and (f == -1 and r == -1):
        break
    else:
        devide_grade(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 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 check(m,f,r):
    if m==-1 or f==-1: return 'F'
    elif m+f >= 80: return 'A'
    elif m+f >= 65 and  m+f < 80: return 'B'
    elif m+f >= 50 and  m+f < 65: return 'C'
    elif m+f >= 30 and  m+f < 50: 
        if r<50: return 'D'
        else: return 'C'
    elif m+f < 30: return 'F'

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

Submission status: Accepted

Solution code:
m = []
f = []
r = []

while True:
    item = list(map(int, input().split()))
    if item == [-1, -1, -1]:
        break
    m.append(item[0])
    f.append(item[1])
    r.append(item[2])

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

for i in range(len(m)):
    print(grade(m[i], f[i], r[i]))

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main (): 
    while True:
        m, f, r = map(int, input().split())
        if m == -1 and f == -1 and r == -1: break
        print (findGrade(m, f, r), end = '\n', flush = True)
    
    
    
    
def findGrade(m ,f, r):
    total = m + f
    if m == -1 or f == -1:
        return 'F'
    elif total >= 80:
        return 'A'
    elif total >= 65:
        return 'B'    
    elif total >= 50:
        return 'C'
    elif total >= 30:
        if r >= 50:
            return 'C'
        else: return 'D'
    else: return 'F'

if __name__ == '__main__': main()

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

Submission status: Accepted

Solution code:
Data = []

while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    else:
        Data.append(list((m, f, r)))
        
Judge = []

for data in Data:
    m, f, r = data[0], data[1], data[2]
    if m + f >= 80:
        Judge.append('A')
    elif (m == -1 or f == -1) or (m + f < 30):
        Judge.append('F')
    elif 65 <= m + f < 80:
        Judge.append('B')
    elif 50 <= m + f < 65 or (30 <= m + f < 50 and r >= 50):
        Judge.append('C')
    elif 30 <= m + f < 50 and r < 50:
        Judge.append('D')

for judge in Judge:
    print(judge, end='\n')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
mfr = []
while True:
    a, b, c = map(int, input().split())
    if a == -1 and b == -1 and c == -1:
        break
    mfr.append([a, b, c])
res = []
for i in range(len(mfr)):
    tmp = mfr[i][0]+mfr[i][1]
    if mfr[i][0] == -1 or mfr[i][1] == -1:
        res.append('F')
    elif tmp >= 80:
        res.append('A')

    elif 65 <= tmp and tmp < 80:
        res.append('B')

    elif 50 <= tmp and tmp < 65:
        res.append('C')

    elif 30 <= tmp and tmp < 50:
        if 50 <= mfr[i][2]:
            res.append('C')
        else:
            res.append('D')

    elif tmp < 30:
        res.append('F')


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def checkGrade(m,f,r):
  if m==-1 or 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'

while True:
  m,f,r = map(int, input().split())
  
  if m+f+r == -3:
    break
  else:
    print(checkGrade(m,f,r))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    x = list(map(int,input().split(' ')))
    if x[0] + x[1] + x[2] == -3:
        break
    elif x[0] == -1 or x[1] == -1:
        print('F',end='\n')
    elif x[0] + x[1] >= 80:
        print('A',end='\n')
    elif x[0] + x[1] >= 65 and x[0] + x[1] < 80:
        print('B', end='\n')
    elif x[0] + x[1] >= 50 and x[0] + x[1] < 65:
        print('C', end='\n')
    elif x[0] + x[1] >= 30 and x[0] + x[1] < 50 and x[2] < 50:
       print('D', end='\n')
    elif x[0] + x[1] >= 30 and x[0] + x[1] < 50 and x[2] >= 50:
        print('C', end='\n')
    elif x[0] + x[1] < 30:
        print('F', end='\n')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
cons=[[0,0,0,0] for i in range(50)]
for i in range(50):
    a,b,c = list(map(int,input().split()))
    if (a+1)*(a+1) + (b+1)*(b+1) + (c+1)*(c+1) == 0:
        break
    asse = 'N'
    if (a == -1) + (b == -1):
        asse = 'F'
    elif a+b < 30:
        asse = 'F'
    elif (a+b <50)*(c < 50):
        asse = 'D'
    elif (a+b<65):
        asse='C'
    elif a+b < 80:
        asse='B'
    elif a+b >= 80:
        asse='A'
    cons[i] = [a,b,c,asse]
for j in range(i):
    print(cons[j][3])

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:
        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 50 <= r:
            print("C")
        else:
            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
    else :
        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")
        else :
            if r >= 50 :
                print("C")
            else :
                print("D")

Submission status: Accepted

Solution code:
m =[]
f =[]
r=[]
for i in range(50):
    m_score,f_score,r_score = map(int,input().split())
    if m_score+f_score+r_score == -3:
        break
    else:
        m.append(m_score)
        f.append(f_score)
        r.append(r_score)

for j in range(len(m)):

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

Submission status: Accepted

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

Submission status: Accepted

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