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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

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
    elif 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 and r>=50:print("C")
    elif 50>m+f>=30 and r<50:print("D")
    elif 30>m+f: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 == 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:
        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 or f==-1:
        if m==-1 and f==-1 and r==-1:
          break
        else:
          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:
for _ in range(50):
    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 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:
# 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
   
   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:
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 and r >= 50 :
        print("C")
    elif (m + f) >= 30 :
        print("D")
    else :
        print("F")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    m,f,r = (int(x) for x in 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 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 = 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 True:
    m,f,r = (int(x) for x in 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 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=map(int,input().split())
    if(m,f,r)==(-1,-1,-1):
        break
    x=m+f
    if m<0 or f<0:
        print("F")
    elif x<30:
        print("F")
    elif x>=80:
        print("A")
    elif x>=65:
        print("B")
    elif x>=50:
        print("C")
    elif r>=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
    sum=m+f
    if m==-1 or 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: Accepted

Solution code:

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

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

for i in range(0, len(l)):
  t = l[i]
  if t[0] == -1 or t[1] == -1:
    print("F")
  elif t[0] + t[1] >= 80:
    print("A")
  elif t[0] + t[1] >= 65 and t[0] + t[1] < 80:
    print("B")
  elif t[0] + t[1] >= 50 and t[0] + t[1] < 65:
    print("C")
  elif t[0] + t[1] >= 30 and t[0] + t[1] < 50:
    if t[2] >= 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

    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:
    a,b,c=map(int,input().split())
    if a==-1 and b==-1 and c==-1:
        break
    elif 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 a+b>=30 and c<50:
        print("D")
    elif a+b>=30 and c>=50:
        print("C")
    elif a+b<30:
        print("F")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
	m, l, r = map(int, input().split())
	if m == -1 and l == -1 and r == -1:
		exit(0)
	elif m == -1 or l == -1:
		print('F')
	elif m + l >= 80:
		print('A')
	elif 65 <= m + l < 80:
		print('B')
	elif 50 <= m + l < 65:
		print('C')
	elif 30 <= m + l < 50:
		if r >= 50:
			print('C')
		else:
			print('D')
	elif m + l < 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
    sum=m+f
    if (m==-1 or 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: 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 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:
def mapt(fn, *args):
    return tuple(map(fn, *args))
    
    
def calc_grades(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 and r >= 50: return "C"
    elif m + f >= 30: return "D"
    elif m + f < 30: return "F"


def Input():
    while True:
        m, f, r= mapt(int, input().split(" "))
        if m == f == r == -1: break
        print(calc_grades(m, f, r))


Input()

Submission status: Accepted

Solution code:
#
# 7a
#

def main():
    while True:
        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:
            print("B")
        elif m+f >= 50 or r >= 50:
            print("C")
        elif m+f >= 30:
            print("D")


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
    sum=m+f
    if m==-1 or 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: Accepted

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

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

Submission status: Accepted

Solution code:
while True:
    x , y , z = map(int,input().split())
    if x == y == z == -1 :
        break
    
    if x == -1:
        print("F")
        
    elif y == -1:
        print("F")
    
    elif z >= 50 :
#        if x + y < 50 & x + y >=30:
        if x + y >=30:
            print("C")

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

Submission status: Accepted

Solution code:

while True :
    m, f, r = (int(x) for x in input().split())
    sum = m + f

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

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

    elif (sum >= 80):
        print("A")

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

    elif (sum >= 50 and sum < 65):
        print("C")

    elif (sum >= 30 and sum < 50):
        if (r >= 50):
            print("C")
        elif (r < 50):
            print("D")

    elif (sum < 30):
        print("F")

Submission status: Accepted

Solution code:
for i in range(50):
  m,f,r=(int(x) for x in input().split())

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

  if m==-1 or 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: Accepted

Solution code:
import sys
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:
        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: 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 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")
    else:
        s=m+f
        if s>=80:
            print("A")
        if 65<=s<80:
            print("B")
        if 50<=s<65:
            print("C")
        if 30<=s<50:
            if r>=50:
                print("C")
            else:
                print("D")
        if s<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
    x = m + f
    if m==-1 or f==-1 : print('F')
    elif x >= 80 : print('A')
    elif x >= 65 : print('B')
    elif x >= 50 : print('C')
    elif x >= 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 == 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 49 <= m+f < 65:
        print("C")
    elif 30 <= m+f < 50 and r >= 50:
        print("C")
    elif 30 <= m+f < 50:
        print("D")
    elif m+f < 30:
        print("F")

Submission status: Accepted

Solution code:
import math
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 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
    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 and r<50:
        print('D')
    elif m+f<30:
        print('F')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import math

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:
while True:
    mid, fin, ree = map(int, input().split())
    if mid == -1 and fin == -1 and ree == -1:
        break
    if mid == -1 or fin == -1:
        print('F')
        continue
    score = mid + fin
    if   score >= 80:
        print('A')
    elif score >= 65:
        print('B')
    elif score >= 50:
        print('C')
    elif score >= 30:
        if ree >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Accepted

Solution code:
a = []
i = 0
n = 0
calc = 0

while True:
    a.append(list(map(int, input().split())))
    if a[n][0] == -1 and a[n][1] == -1 and a[n][2] == -1:
        break
    n += 1

while i < n:
    calc = a[i][0] + a[i][1]

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

Submission status: Accepted

Solution code:
for i in range(50):
    a,b,c = map(int,input().split())
    d = a+b
    if a == b == c == -1:
        exit()
    elif a == -1 or b == -1 or d < 30:
        print("F")
    elif 80 <= d:
        print("A")
    elif 65 <= d < 80:
        print("B")
    elif 50 <= d < 65 or (30 <= d < 50 and 50 <= c):
        print("C")
    elif 30 <= d < 50:
        print("D")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

num=[]
while True:
    num.append(list(map(int,input().split(" "))))
    if num[-1]==[-1,-1,-1]:
        num=num[:-1]
        break

def saiten(lst):
    tmp=""
    if lst[0]== -1 or lst[1]== -1:
        tmp="F"
    elif lst[0]+lst[1]>=80:
        tmp="A"
    elif lst[0]+lst[1]>=65:
        tmp="B"
    elif lst[0]+lst[1]>=50:
        tmp="C"
    elif lst[0]+lst[1]>=30:
        if lst[2]>=50:
            tmp="C"
        else:
            tmp="D"
    else:
        tmp="F"
    return tmp
ans=[saiten(i)for i in num]
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
import sys
while True:
    m, f, r = map(int, input().split())
    if m == f == r == -1:
        sys.exit()
    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):
    var=input()
    var=var.split()
    m=int(var[0])
    r=int(var[1])
    f=int(var[2])
    if(m==r==f==-1):
        break
    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)<80):
        print("C")
    elif(30<=(m+r)<50 and f<50):
        print("D")
    elif(30<=(m+r)<50 and f>=50):
        print("C")
    elif((m+r)<30):
        print("F")

Submission status: Accepted

Solution code:
results = []
grades = []

while True:
    result = list(map(int, input().split()))
    if result == [-1, -1, -1]:
        break
    results.append(result)
    
#print(results)

for i in range(len(results)):
    mid = results[i][0]
    ret = results[i][2]
    fin = results[i][1]
    if mid == -1 or fin == -1:
        grades.append("F")
    elif mid + fin >= 80:
        grades.append("A")
    elif mid + fin >= 65 and mid + fin < 80:
        grades.append("B")
    elif mid + fin >= 50 and mid + fin < 65:
        grades.append("C")
    elif mid + fin >= 30 and mid + fin < 50:
        if ret >= 50:
            grades.append("C")
        else:   
            grades.append("D")
    else:
        grades.append("F")
    
for i in range(len(results)):
    print(grades[i])

Submission status: Accepted

Solution code:
#66 成績

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

Submission status: Accepted

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