Problem:

Grading

  Write a program which reads a list of student test scores and evaluates the performance for each student.

  The test scores for a student include scores of the midterm examination m (out of 50), the final examination f (out of 50) and the makeup examination r (out of 100). If the student does not take the examination, the score is indicated by -1.

  The final performance of a student is evaluated by the following procedure:

  
If the student does not take the midterm or final examination, the student's grade shall be F.

  
If the total score of the midterm and final examination is greater than or equal to 80, the student's grade shall be A.

  
If the total score of the midterm and final examination is greater than or equal to 65 and less than 80, the student's grade shall be B.

  
If the total score of the midterm and final examination is greater than or equal to 50 and less than 65, the student's grade shall be C.

  
If the total score of the midterm and final examination is greater than or equal to 30 and less than 50, the student's grade shall be D. However, if the score of the makeup examination is greater than or equal to 50, the grade shall be C.

  
If the total score of the midterm and final examination is less than 30, the student's grade shall be F.

Input

  The input consists of multiple datasets. For each dataset, three integers m, f and r are given in a line.

  The input ends with three -1 for m, f and r respectively. Your program should not process for the terminal symbols.

The number of datasets (the number of students) does not exceed 50.

Output

  For each dataset, print the grade (A, B, C, D or F) in a line.

Sample Input

40 42 -1
20 30 -1
0 2 -1
-1 -1 -1

Sample Output

A
C
F



Sample input:
40 42 -1
20 30 -1
0 2 -1
-1 -1 -1


Sample output:
A
C
F

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
def main():
    for line in sys.stdin:
        m, f, r = map(int, line.split())
        if m == -1 and f == -1 and r == -1:
            break
        else:
            total = m * f
            if m == -1 or f == -1:
                print("F")
            elif total >= 80:
                print("A")
            elif 65 <= total < 80:
                print("B")
            elif 50 <= total < 65:
                print("C")
            elif 30 <= total < 50:
                if r >= 50:
                    print("C")
                else:
                    print("D")
            elif total < 30:
                print("F")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
while():
    m,f,r = list(map(int, input().split()))
    
    if (m==-1 & f == -1 & r==-1):
        break
        
    #??????????¨??????????????¨????????????????????¬????????????´???????????? F???
    if (m == -1 | f == -1):
        print ("F")
    #??????????¨???¨??????????¨????????¨??????°??? 80 ??\???????????°????????? A ???
    elif (m + f >= 80):
        print ("A")
    #??????????¨???¨??????????¨????????¨??????°??? 65 ??\??? 80 ??????????????°????????? B???
    elif (m+f >= 65):    
        print ("B")
    #??????????¨???¨??????????¨????????¨??????°??? 50 ??\??? 65 ??????????????°????????? C???
    elif (m+f >= 65):
        print ("C")
    #??????????¨???¨??????????¨????????¨??????°??? 30 ??\??? 50 ??????????????°????????? D??? ???????????????????¨?????????°??? 50 ??\???????????°????????? C???
    elif (m+f >= 30):
        if (r >= 50):
            print ("C")
        else:
            print ("D")
    #??????????¨???¨??????????¨????????¨??????°??? 30 ??????????????°????????? F???
    elif (m+f<30):
        print ("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = list(map(int, input().split()))
    
    if (m==-1 & f == -1 & r==-1):
        break
        
    #??????????¨??????????????¨????????????????????¬????????????´???????????? F???
    if (m == -1 | f == -1):
        print ("F")
    #??????????¨???¨??????????¨????????¨??????°??? 80 ??\???????????°????????? A ???
    elif (m + f >= 80):
        print ("A")
    #??????????¨???¨??????????¨????????¨??????°??? 65 ??\??? 80 ??????????????°????????? B???
    elif (m+f >= 65):    
        print ("B")
    #??????????¨???¨??????????¨????????¨??????°??? 50 ??\??? 65 ??????????????°????????? C???
    elif (m+f >= 65):
        print ("C")
    #??????????¨???¨??????????¨????????¨??????°??? 30 ??\??? 50 ??????????????°????????? D??? ???????????????????¨?????????°??? 50 ??\???????????°????????? C???
    elif (m+f >= 30):
        if (r >= 50):
            print ("C")
        else:
            print ("D")
    #??????????¨???¨??????????¨????????¨??????°??? 30 ??????????????°????????? F???
    elif (m+f<30):
        print ("F")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 15 02:01:12 2017

@author: Admin
"""

while True:
    m,f,r = list(map(int, input().split()))
    
    if (m==-1 & f == -1 & r==-1):
        break
        
    #??????????¨??????????????¨????????????????????¬????????????´???????????? F???
    if (m == -1 | f == -1):
        print ("F")
    #??????????¨???¨??????????¨????????¨??????°??? 80 ??\???????????°????????? A ???
    elif (m + f >= 80):
        print ("A")
    #??????????¨???¨??????????¨????????¨??????°??? 65 ??\??? 80 ??????????????°????????? B???
    elif (m+f >= 65):    
        print ("B")
    #??????????¨???¨??????????¨????????¨??????°??? 50 ??\??? 65 ??????????????°????????? C???
    elif (m+f >= 50):
        print ("C")
    #??????????¨???¨??????????¨????????¨??????°??? 30 ??\??? 50 ??????????????°????????? D??? ???????????????????¨?????????°??? 50 ??\???????????°????????? C???
    elif (m+f >= 30):
        if (r >= 50):
            print ("C")
        else:
            print ("D")
    #??????????¨???¨??????????¨????????¨??????°??? 30 ??????????????°????????? F???
    elif (m+f<30):
        print ("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = list(map(int, input().split()))
    
    if (m==-1 & f == -1 & r==-1):
        break
        
    #??????????¨??????????????¨????????????????????¬????????????´???????????? F???
    if (m == -1 | f == -1):
        print ("F")
    #??????????¨???¨??????????¨????????¨??????°??? 80 ??\???????????°????????? A ???
    elif (m + f >= 80):
        print ("A")
    #??????????¨???¨??????????¨????????¨??????°??? 65 ??\??? 80 ??????????????°????????? B???
    elif (m+f >= 65):    
        print ("B")
    #??????????¨???¨??????????¨????????¨??????°??? 50 ??\??? 65 ??????????????°????????? C???
    elif (m+f >= 50):
        print ("C")
    #??????????¨???¨??????????¨????????¨??????°??? 30 ??\??? 50 ??????????????°????????? D??? ???????????????????¨?????????°??? 50 ??\???????????°????????? C???
    elif (m+f <= 50):
        if (r >= 50):
            print ("C")
        else:
            print ("D")
    #??????????¨???¨??????????¨????????¨??????°??? 30 ??????????????°????????? F???
    elif (m+f<30):
        print ("F")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while 1:
  m,f,r=map(int,input().split())
  if m == f == r == -1:break
  if m == -1 or f == -1 or m+f < 30:print('F')
  for k,v in {'A':80,'B':65,'C':50,'D':30}.items():
    if k == 'D' and r >= 50:print('C')
    if m + f >= v:print(k);break

Submission status: Wrong Answer

Solution code:
while 1:
  m,f,r=map(int,input().split())
  if m == f == r == -1:break
  if m == -1 or f == -1 or m+f < 30:print('F')
  for k,v in {'A':80,'B':65,'C':50,'D':30}.items():
    if k == 'D' and r >= 50:print('C')
    if m + f >= v:
      print(k)
      break

Submission status: Wrong Answer

Solution code:
while 1:
  m,f,r=map(int,input().split())
  if m == f == r == -1:break
  if m == -1 or f == -1 or m+f < 30:print('F')
  for k,v in {'A':80,'B':65,'C':50,'D':30}.items():
    if k == 'D' and r >= 50:print('C');break
    if m + f >= v:
      print(k)
      break

Submission status: Wrong Answer

Solution code:
while 1:
  m,f,r=map(int,input().split())
  if m == f == r == -1:
    break
  if m == -1 or f == -1 or m+f < 30:
    print('F')
  else:
    for k,v in {'A':80,'B':65,'C':50,'D':30}.items():
      if k == 'D' and r >= 50:
        print('C')
        break
      if m + f >= v:
        print(k)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while 1:
  m,f,r=map(int,input().split())
  if m == f == r == -1:break
  if m == -1 or f == -1 or m+f < 30:print('F')
  else:
    for k,v in {'A':80,'B':65,'C':50,'D':30}.items():
      if k == 'D' and r >= 50:print('C');break
      if m + f >= v:print(k);break

Submission status: Wrong Answer

Solution code:
while 1:
  m,f,r=map(int,input().split())
  if m==f==r==-1:break
  if m ==-1 or f==-1 or m+f<30:print('F')
  else:
    for k,v in{'A':80,'B':65,'C':50,'D':30}.items():
      if k =='D'and r>=50:print('C');break
      if m+f>=v:print(k);break

Submission status: Wrong Answer

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

import fileinput
import math

def main():

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

res = []
while True:
    m, f, v = map(int, input().split())
    if m == f == v == -1:
        break;
    res.append(seiseki(m, f, v))

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

Submission status: Wrong Answer

Solution code:
while 1:
 m,f,r=map(int,input().split())
 if m==f==r==-1:break
 if m+f>79:print('A')
 elif m+f>64:print('B')
 elif m+f>49 or r>49:print('C')
 elif m+f>29:print('D')
 else:print('F')

Submission status: Wrong Answer

Solution code:
while 1:
 m,f,r=map(int,input().split())
 if m==f==r==-1:break
 if m+f>79:print('A')
 elif m+f>64:print('B')
 elif m+f>49:print('C')
 elif m+f>29:print('D') if r>49 else print('C')
 else:print('F')

Submission status: Wrong Answer

Solution code:
while 1:
 m,f,r=map(int,input().split())
 if m==f==r==-1:break
 if m==-1 or f==-1:print('F')
 elif m+f>79:print('A')
 elif m+f>64:print('B')
 elif m+f>49:print('C')
 elif m+f>29:print('D') if r>49 else print('C')
 else:print('F')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while True:
    a = input().split()
    m = int(a[0])
    f = int(a[1])
    r = int(a[2])
    if m == f == r == -1:
        break
    b = m + f
    if b >= 80:
        print("A")
    elif 65 <= b < 80:
        print("B")
    elif 50 <= b < 65:
        print("C")
    elif 30 <= b <50:
        print("D")
        if 50 <= r:
            print("C")
    elif b < 30:
        print("F")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding:utf-8
while True:
    m,f,r = map(int, raw_input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if 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: Wrong Answer

Solution code:
def solve(m, f, r):
    if (m == -1 or f == -1) or m + f < 30:
        return "F"
    for a, b in ((80, "A"), (65, "B"), (50, "C")):
        if m + f >= a:
            return b
    if r >= 50:
        return "C"
    return "F"
while True:
    m, f, r = map(int, input().split())
    if m == f == r == -1:
        break
    print(solve(m, f, r))

Submission status: Wrong Answer

Solution code:
while(1):
    m,f,r = map(int,raw_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: Wrong Answer

Solution code:
while(1):
    m,f,r = map(int,raw_input().split())
    if(m == -1 and f == -1 and r == -1):
        break
    if m == -1:
        m = 0
    elif f == -1:
        f = 0
    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: Wrong Answer

Solution code:
while(1):
    m,f,r = map(int,raw_input().split())
    if(m == -1 and f == -1 and r == -1):
        break
    if m == -1:
        m = 0
    elif f == -1:
        f = 0
    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: Wrong Answer

Solution code:
while(1):
    m,f,r = map(int,raw_input().split())
    if(m == -1 and f == -1 and r == -1):
        break
    if(m == -1 or f == -1):
        print "F"
    if m == -1:
        m = 0
    elif f == -1:
        f = 0

    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: Wrong Answer

Solution code:
while 1:
 m,f,r=map(int,input().split());s=m+f
 if m==f==r<0:break
 if m*f<0 | s<30:print('F')
 elif s<50 * r<50:print('D')
 elif s<65:print('C')
 elif s<80:print('B')
 else:print('A')

Submission status: Wrong Answer

Solution code:
while 1:
 m,f,r=map(int,input().split());s=m+f
 if m==f==r<0:break
 if m*f<0 | s<30:print('F')
 elif(s<50)*(r<50):print('D')
 elif s<65:print('C')
 elif s<80:print('B')
 else:print('A')

Submission status: Wrong Answer

Solution code:
for _ in range(10000):
    res = list(map(int,input().split()))
    if res == [-1,-1,-1]:
        break
    su = res[0]+res[1]
    if su<30:
        gr="F"
    elif su<50:
        if res[2]>=50:
            gr="C"
        else:
            gr="D"
    elif su<65:
        gr="C"
    elif su<80:
        gr="B"
    else:
        gr="A"
    print(gr)

Submission status: Wrong Answer

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

while not(m == -1 and f == -1 and r == -1):
	if 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")
	m, f, r = map(int, input().split())

Submission status: Wrong Answer

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

while not(m == -1 and f == -1 and r == -1):
	if m == -1:
		m = 0
	if f == -1:
		f = 0
	if 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")
	m, f, r = map(int, input().split())

Submission status: Wrong Answer

Solution code:
while True:
    value = list(map(int, str(input()).split()))
    if value[0] == -1 and value[1] == -1 and value[2] == -1:
        break

    if value[0] == -1 or value[1] == -1:
        print("F")

    sum = value[0] + value[1]

    if sum >= 80:
        print("A")
    elif sum >= 65:
        print("B")
    elif sum >= 50:
        print("C")
    elif value[2] >= 50:
        print("C")
    elif sum >= 30:
        print("D")
    else:
        print("F")

Submission status: Wrong Answer

Solution code:
while True:
    value = list(map(int, str(input()).split()))
    if value[0] == -1 and value[1] == -1 and value[2] == -1:
        break

    if value[0] == -1 or value[1] == -1:
        print("F")

    sum = value[0] + value[1]

    if sum >= 80:
        print("A")
    elif sum >= 65:
        print("B")
    elif sum >= 50:
        print("C")
    elif value[2] >= 50:
        print("C")
    elif sum >= 30:
        print("D")
    else:
        print("F")

Submission status: Wrong Answer

Solution code:
N=int(0)
i=int(0)
m,f,r,point=[],[],[],[]
while 1:
    point=list(map(int,input().split(' ')))
    m.append(point[0])
    f.append(point[1])
    r.append(point[2])
    if(m[i]==-1&f[i]==-1&r[i]==-1):
        break
    N=N+1
    i=i+1
i=0
while (i<N):
    if(m[i]+f[i]>=80):
        print('A')
    elif(m[i]+f[i]>=65 and m[i]+f[i]<80):
        print('B')
    elif(m[i]+f[i]>=50 and m[i]+f[i]<65):
        print('C')
    elif(m[i]+f[i]>=30 and m[i]+f[i]<50):
        if(r[i]>=50):
            print('C')
        else:
            print('D')
    elif(m[i]+f[i]<30):
        print('F')
    i=i+1

Submission status: Wrong Answer

Solution code:
N=int(0)
i=int(0)
m,f,r,point=[],[],[],[]
while 1:
    point=list(map(int,input().split(' ')))
    m.append(point[0])
    f.append(point[1])
    r.append(point[2])
    if(m[i]==-1&f[i]==-1&r[i]==-1):
        break
    N=N+1
    i=i+1
i=0
while (i<N):
    if(m[i]==-1):
        m[i]=0
    elif(f[i]==-1):
        f[i]=0
    elif(r[i]==-1):
        r[i]==0
    if(m[i]+f[i]>=80):
        print('A')
    elif(m[i]+f[i]>=65 and m[i]+f[i]<80):
        print('B')
    elif(m[i]+f[i]>=50 and m[i]+f[i]<65):
        print('C')
    elif(m[i]+f[i]>=30 and m[i]+f[i]<50):
        if(r[i]>=50):
            print('C')
        else:
            print('D')
    elif(m[i]+f[i]<30):
        print('F')
    i=i+1

Submission status: Wrong Answer

Solution code:
N=int(0)
i=int(0)
m,f,r,point=[],[],[],[]
while 1:
    point=list(map(int,input().split(' ')))
    m.append(point[0])
    f.append(point[1])
    r.append(point[2])
    if(m[i]==-1&f[i]==-1&r[i]==-1):
        break
    N=N+1
    i=i+1
i=0
while (i<N):
    if(m[i]==-1):
        m[i]=0
    elif(f[i]==-1):
        f[i]=0
    elif(r[i]==-1):
        r[i]==0
    if(m[i]+f[i]>=80 and m[i]!=0 and f[i]!=0):
        print('A')
    elif(m[i]+f[i]>=65 and m[i]+f[i]<80 and m[i]!=0 and f[i]!=0):
        print('B')
    elif(m[i]+f[i]>=50 and m[i]+f[i]<65 and m[i]!=0 and f[i]!=0):
        print('C')
    elif(m[i]+f[i]>=30 and m[i]+f[i]<50 and m[i]!=0 and f[i]!=0):
        if(r[i]>=50):
            print('C')
        else:
            print('D')
    elif(m[i]+f[i]<30 or m[i]==0 or f[i]==0):
        print('F')
    i=i+1

Submission status: Wrong Answer

Solution code:
import sys

l = []
for i in sys.stdin:
    l.append(i.split())

for i in range(0,len(l)):
    if int(l[i][0]) == -1 and int(l[i][1]) == -1:
        continue
    elif int(l[i][0]) + int(l[i][1]) >= 80:
        print('A')
    elif int(l[i][0]) + int(l[i][1]) < 80 and int(l[i][0]) + int(l[i][1]) >= 65:
        print('B')
    elif int(l[i][0]) + int(l[i][1]) < 65 and int(l[i][0]) + int(l[i][1]) >= 50:
        print('C')
    elif int(l[i][0]) + int(l[i][1]) < 50 and int(l[i][0]) + int(l[i][1]) >= 30:
        print('D')
    else:
        print('F')

Submission status: Wrong Answer

Solution code:
import sys

l = []
for i in sys.stdin:
    l.append(i.split())

for i in range(0,len(l)-1):
    if int(l[i][0]) == -1 or int(l[i][1]) == -1:
        print('F')
    elif int(l[i][0]) + int(l[i][1]) >= 80:
        print('A')
    elif int(l[i][0]) + int(l[i][1]) < 80 and int(l[i][0]) + int(l[i][1]) >= 65:
        print('B')
    elif (int(l[i][0]) + int(l[i][1]) < 65 and int(l[i][0]) + int(l[i][1]) >= 50) or (int(l[i][0]) + int(l[i][1]) < 50 and int(l[i][1]) >= 50):
        print('C')
    elif int(l[i][0]) + int(l[i][1]) < 50 and int(l[i][0]) + int(l[i][1]) >= 30:
        print('D')
    else:
        print('F')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = tuple(int(n) for n in 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")
    else:
        if r >= 50:
            print("C")
        else:
            print("F")

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = tuple(int(n) for n in 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")
    else:
        if r >= 50:
            print("C")
        else:
            print("D")

Submission status: Wrong Answer

Solution code:
while True:
    中間, 期末, 再試験 = map(int, input().split())
    if 中間 < 0 and 期末 < 0 and 再試験 < 0:
        break
    if 中間 < 0 or 期末 < 0:
        print("F")
    合計点 = 中間 + 期末
    
    if 合計点 >= 80:
        print("A")
    elif 65 <= 合計点 and 合計点 < 80:
        print("B")
    elif 50 <= 合計点 and 合計点 < 65:
        print("C")
    elif 30 <= 合計点 and 合計点 < 50:
        if 再試験 >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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