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:
score = []

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

for i in range(len(score)):
    if score[i][0][0] + score[i][1][0] >= 80:
       print('A')
    elif score[i][0][0] + score[i][1][0] >= 65:
        print('B')
    elif score[i][0][0] + score[i][1][0] >= 50:
        print('C')
    elif score[i][0][0] + score[i][1][0] >= 30:
        print('C') if score[i][2][0] >= 50 else print('D')
    else:
        print('F')

Submission status: Wrong Answer

Solution code:
score = []

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

for i in range(len(score)):
    if score[i][0][0] + score[i][1][0] >= 80:
       print('A')
    elif score[i][0][0] + score[i][1][0] >= 65:
        print('B')
    elif score[i][0][0] + score[i][1][0] >= 50:
        print('C')
    elif score[i][0][0] + score[i][1][0] >= 30:
        print('C') if score[i][2][0] >= 50 else print('F')
    else:
        print('F')

Submission status: Wrong Answer

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

import sys

for l in sys.stdin:
    m, f, r = map(int,l.split())
    if f == -1 and m == -1 and r == -1:
        break
    print (seiseki(m,f,r))

Submission status: Wrong Answer

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

import sys

for l in sys.stdin:
    m, f, r = map(int,l.split())
    if f == -1 and m == -1 and r == -1:
        break
    print (seiseki(m,f,r))

Submission status: Wrong Answer

Solution code:
while 1:
    m,f,r=map(int,raw_input().split())
    #m:Midterm exam  f:final exam r:Retest
    score=m+f
    if m == -1 or f == -1 :
        if r == -1 :
            break
        else:
            print 'F'
    else :
        if score >= 80:
            print 'A'
        else:
            if score >= 65:
                print 'B'
            else:
                if score >= 50 or (score >= 30 and r >= 50):
                    print 'C'
                else:
                    if score >= 30:
                        print 'D'
                    else:
                        print 'F'

Submission status: Wrong Answer

Solution code:
import sys


def main():
    while True:
        m, f, r = [int(score) for score in sys.stdin.readline().split()]
        if r == f == 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')
        elif m+f < 30:
            print('F')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
pupils = []

while True:
    l = list(map(int, input().split()))
    if sum(l) == -3:
        break
    pupils.append(l)

for pupil in pupils:
    score = pupil[0] + pupil[1]
    if pupil[0] == -1 or  pupil[1] == -1:
        rank = 'F'
    elif score >= 80:
        rank = 'A'
    elif score >= 65:
        rank = 'B'
    elif (score >= 50) or (score >= 30 and pupil[2] >= 50):
        rank = 'C'
    else:
        rank = 'F'
    print(rank)

Submission status: Wrong Answer

Solution code:
def ifExit(a):
    if a[0] =='-1' and a[1] =='-1' and a[2] =='-1':
        return True
    else:
        return False



l=[]

while(True):
    tmp = input().split()
    if ifExit(tmp): break

    m=int(tmp[0])
    f=int(tmp[1])
    r=int(tmp[2])

    if (m == 0) or (f == 0) :
        l.append('F')
    elif (m+f >= 80):
        l.append('A')
    elif (80 > m+f and m+f >= 65):
        l.append('B')
    elif (65 > m+f and m+f >= 50):
        l.append('C')
    elif (50 > m+f and m+f >= 30):
        if r>=50:
            l.append('C')
        else:
            l.append('D')
    else:
        l.append('F')

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

Submission status: Wrong Answer

Solution code:
def ifExit(a):
    if a[0] =='-1' and a[1] =='-1' and a[2] =='-1':
        return True
    else:
        return False



l=[]

while(True):
    tmp = input().split()
    if ifExit(tmp): break

    m=int(tmp[0])
    f=int(tmp[1])
    r=int(tmp[2])

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

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

Submission status: Wrong Answer

Solution code:
m = 0
f = 0
r = 0
while m!=-1 or f!=-1 or r!=-1:
	m,f,r = [int(i) for i in input().split()]
	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')

Submission status: Wrong Answer

Solution code:
while True:
    m,f,r = map(int,input().split())
    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')

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Here your code !

def func():
    data=[]
    while(True):
        try:
            line=[ int(item) for item in input().rstrip().split(" ") ]
            if(line == [-1, -1, -1]):
                break
            data.append(line)
        except EOFError:
            break
        except:
            return inputError()

    result=""
    for score in data:
        if(score[0]+score[1] >= 80):
            result+="A\n"
        elif(score[0]+score[1] >= 65):
            result+="B\n"
        elif(score[0]+score[1] >= 50):
            result+="C\n"
        elif(score[0]+score[1] >= 30):
            if(score[2] >= 50):
                result+="C\n"
            else:
                result+="D\n"
        else:
            result+="F\n"
    
    print(result.rstrip())

def inputError():
    print("input error")
    return -1

func()

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
L = []
m, f, r = map(int, input().split())
while not(m == -1 and f == -1 and r == -1):
 L.append([m, f, r])
 m, f, r = map(int, input().split())

for i in L:
 if i[0] == -1 and i[1] == -1:
  print("F")
 elif i[0] + i[1] >= 80:
  print("A")
 elif i[0] + i[1] >= 65:
  print("B")
 elif i[0] + i[1] >=  50:
  print("C")
 elif i[0] + i[1] >= 30 and i[2] >=50:
  print("C")
 elif i[0] + i[1] >= 30:
  print("D")
 else:
  print("F")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while True:
	numlist = list(int(i) for i in input().split())
	mid = numlist[0]
	final = numlist[1]
	retest = numlist[2]

	if mid == -1 and final == -1 and retest == -1:
		break

	if mid == -1 or final == -1:
		print("F")

	sum = mid + final

	if sum >= 80:
		print("A")
	elif 80 > sum >= 65:
		print("B")
	elif 65 > sum >= 50:
		print("C")
	elif 50 > sum >= 30:
		print("D")
	elif retest >= 50:
		print("C")
	elif sum < 30:
		print("F")

Submission status: Wrong Answer

Solution code:
while True:
	numlist = list(int(i) for i in input().split())
	mid = numlist[0]
	final = numlist[1]
	retest = numlist[2]

	if mid == -1 and final == -1 and retest == -1:
		break

	if mid == -1 or final == -1:
		print("F")

	sum = mid + final

	if sum >= 80:
		print("A")
	elif 80 > sum >= 65:
		print("B")
	elif 65 > sum >= 50:
		print("C")
	elif 50 > sum >= 30:
		print("D")
	elif 50 > sum >= 30 and retest >= 50:
		print("C")
	elif sum < 30:
		print("F")

Submission status: Wrong Answer

Solution code:
while True:
	numlist = list(int(i) for i in input().split())
	mid = numlist[0]
	final = numlist[1]
	retest = numlist[2]

	if mid == -1 and final == -1 and retest == -1:
		break

	if mid == -1 or final == -1:
		print("F")

	sum = mid + final

	if sum >= 80:
		print("A")
	elif 80 > sum >= 65:
		print("B")
	elif 65 > sum >= 50:
		print("C")
	elif 50 > sum >= 30 and retest < 50:
		print("D")
	elif 50 > sum >= 30 and retest >= 50:
		print("C")
	elif sum < 30:
		print("F")

Submission status: Wrong Answer

Solution code:
while 1 :
    x,y,z=[int(i) for i in input().split()]
    if x==-1:
        break
    if x==0 or y==0:
        print('F')
    elif x+y>=80:
        print('A')
    elif x+y>=65:
        print('B')
    elif x+y>=50:
        print('C')
    elif x+y>30:
        if z>=50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Wrong Answer

Solution code:
while 1 :
    x,y,z=[int(i) for i in input().split()]
    if x==y==z==-1:
        break
    if x==-1 or y==-1:
        print('F')
    elif x+y>=80:
        print('A')
    elif x+y>=65:
        print('B')
    elif x+y>=50:
        print('C')
    elif x+y>30:
        if z>=50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
??´?????????
"""

while True:
    inp = input().split(" ")
    m = int(inp[0])
    f = int(inp[1])
    r = int(inp[2])
    
    if m < 0 and f < 0 and r < 0 :
        break
    
    if m < 0 or f < 0 :
        S = "F"
    else:
        t = m + f
        if t < 50:
            if r >= 50:
                S = "C"
            else:
                S = "D"
        elif t < 65:
            S = "C"
        elif t < 80:
            S = "B"
        else:
            S = "A"

    print(S)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
??´?????????
"""

while True:
    inp = input().strip().split(" ")
    m = int(inp[0])
    f = int(inp[1])
    r = int(inp[2])
#    print(inp[1])
    
    if m < 0 and f < 0 and r < 0 :
        break
    
    if m < 0 or f < 0 :
        S = "F"
    else:
        t = m + f
        if t < 50:
            if r >= 50:
                S = "C"
            else:
                S = "D"
        elif t < 65:
            S = "C"
        elif t < 80:
            S = "B"
        else:
            S = "A"

    print(S)

Submission status: Wrong Answer

Solution code:
x=1
y=1
r=1
result=[]
while x>=0:
    if x ==-1 and y == -1 and r == -1:
        break
    else:
        x,y,r = map(int,input().split())
        result.append([x,y,r])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

    if points == [-1,-1,-1]:
        break

    gou = points[0] + points[1]
    if gou >= 80:
        print("A")
    elif 65 <= gou < 80:
        print("B")
    elif 50 <= gou < 65:
        print("C")
    elif 30 <= gou < 50:
        if points[2] >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Submission status: Wrong Answer

Solution code:
while(1):
	chuukan, kimatsu, saishi = map(int, input().split())
	state = "None"
	
	if chuukan == kimatsu == saishi == -1:
		break
	elif (chuukan or kimatsu) == -1:
		state = "F"
	elif (chuukan*2 + kimatsu*2)/2 >= 80:
		state = "A"
	elif (chuukan*2 + kimatsu*2)/2 >= 65:
		state = "B"
	elif (chuukan*2 + kimatsu*2)/2 >= 50:
		state = "C"
	elif (chuukan*2 + kimatsu*2)/2 >= 30:
		if saishi >= 50:
			state = "C"
		else:
			state = "B"
	else:
		state = "D"

	print("DBG ::chuukan{} kimatsu{} saishi{} STATE[{}]".format(chuukan, kimatsu, saishi, state))

Submission status: Wrong Answer

Solution code:
while(1):
	chuukan, kimatsu, saishi = map(int, input().split())
	state = "None"
	
	if chuukan == kimatsu == saishi == -1:
		break
	elif (chuukan or kimatsu) == -1:
		state = "F"
	elif (chuukan*2 + kimatsu*2)/2 >= 80:
		state = "A"
	elif (chuukan*2 + kimatsu*2)/2 >= 65:
		state = "B"
	elif (chuukan*2 + kimatsu*2)/2 >= 50:
		state = "C"
	elif (chuukan*2 + kimatsu*2)/2 >= 30:
		if saishi >= 50:
			state = "C"
		else:
			state = "B"
	else:
		state = "D"

	print(state)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
m = 0
f = 0
r = 0

while(True):
    I = input().split()
    m = int(I[0])
    f = int(I[1])
    r = int(I[2])
    if m == -1 and f == -1 and r == -1:
        break
    score = m + f
    if score >= 80:
        print('A')
    if 65 <= score and score < 80:
        print('B')
    if 50 <= score and score < 65:
        print('C')
    if 30 <= score and score < 50:
        if r >= 50:
            print('C')
        else:
            print('D')
    if score < 30:
        print('F')

Submission status: Wrong Answer

Solution code:
def check(n):
    if n < 0:
        n = 0
    return n

m = 0
f = 0
r = 0

while(True):
    I = input().split()
    m = int(I[0])
    f = int(I[1])
    r = int(I[2])
    if m == -1 and f == -1 and r == -1:
        break
    m = check(m)
    f = check(f)
    r = check(r)
    score = m + f
    if score >= 80:
        print('A')
    if 65 <= score and score < 80:
        print('B')
    if 50 <= score and score < 65:
        print('C')
    if 30 <= score and score < 50:
        if r >= 50:
            print('C')
        else:
            print('D')
    if score < 30:
        print('F')

Submission status: Wrong Answer

Solution code:
scores = []
while True:
    score = list(map(int, input().split()))
    if score[0] == -1 and score[1] == -1 and score[2] == -1:
        break
    else:
        scores.append(score)
        
print(scores)
for i in scores:
    mid_exam = i[0]
    final_exam = i[1]
    re_exam = i[2]
    total = i[0] + i[1]
    if mid_exam == -1 or final_exam == -1:
        print("F")
    elif total >= 80:
        print("A")
    elif total in range(65, 80):
        print("B")
    elif total in range(50, 65):
        print("C")
    elif total < 30:
        print("F")
    elif total in range(30, 50):
        if re_exam >= 50:
            print("C")
        else:
            print("D")

Submission status: Wrong Answer

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

print(scores)
for i in scores:
    mid_exam = i[0]
    final_exam = i[1]
    re_exam = i[2]
    total = i[0] + i[1]
    if mid_exam == -1 or final_exam == -1:
        print("F")
    elif total >= 80:
        print("A")
    elif total in range(65, 80):
        print("B")
    elif total in range(50, 65):
        print("C")
    elif 30 <= total < 50:
        if re_exam >= 50:
            print("C")
        else:
            print("D")
    elif total < 30:
        print("F")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

elif m+f>=80:
    print("A")

elif 65<=m+f<80:
    print("B")

elif 50<=m+f<65:
    pritn("C")

elif 30<=m+f<50:
    print("D")

elif 30<m+f<50 and r>50:
    print("C")

elif m+f<30:
    print("F")

Submission status: Wrong Answer

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


if m+f>=80:
    print("A")

elif 65<=m+f<80:
    print("B")

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

elif 30<=m+f<50:
    print("D")

elif 30<m+f<50 and r>50:
    print("C")

elif m+f<30:
    print("F")

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

Submission status: Wrong Answer

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

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

    elif 65<=m+f<80:
        print("B")

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

    elif 30<=m+f<50:
        print("D")

    elif 30<m+f<50 and r>50:
        print("C")

    elif m+f<30:
        print("F")

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

    elif  m+f>=80:
        print("A")

Submission status: Wrong Answer

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

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

    elif 65<=m+f<80:
        print("B")

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

    elif 30<=m+f<50:
        print("D")

    elif 30<m+f<50 and r>50:
        print("C")

    elif  m+f>=80:
        print("A")

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

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

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

    elif 65<=m+f<80:
        print("B")

 

    elif 30<=m+f<50:
        print("D")

    elif 30<m+f<50 and r>50:
        print("C")

    elif  m+f>=80:
        print("A")

    else:
        print("F")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python
# -*- coding : utf-8 -*-
while True:
    m, f, r = map(int,input().split())
    if r == f == m == -1:
        break
    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: Wrong Answer

Solution code:
result = []
while True:
    m, f, r = map(int, input().split())
    if m == -1 and f == -1:
        break
    if m + f >= 80:
        result.append('A')
    if 80 > m + f >= 65:
        result.append('B')
    if 65 > m + f >= 50:
        result.append('C')
    if 50 > m + f >= 30:
        result.append('D')
    if 30 > m + f:
        result.append('F')
print('\n'.join(result))

Submission status: Wrong Answer

Solution code:
result = []
while True:
    m, f, r = map(int, input().split())
    if (m, f) == (-1, -1):
        break
    if m == -1 or f == -1:
        result.append('F')
    if m + f >= 80:
        result.append('A')
    if 80 > m + f >= 65:
        result.append('B')
    if 65 > m + f >= 50:
        result.append('C')
    if 50 > m + f >= 30:
        result.append('D')
    if 30 > m + f:
        result.append('F')
print('\n'.join(result))

Submission status: Wrong Answer

Solution code:
result = []
while True:
    m, f, r = map(int, input().split())
    if (m, f) == (-1, -1):
        break
    if m == -1 or f == -1:
        result.append('F')
    if m + f >= 80:
        result.append('A')
    if 80 > m + f >= 65:
        result.append('B')
    if 65 > m + f >= 50:
        result.append('C')
    if 50 > m + f >= 30:
        result.append(['D', 'C'][r >= 50])
    if 30 > m + f:
        result.append('F')
print('\n'.join(result))

Submission status: Wrong Answer

Solution code:
result = []
while True:
    m, f, r = map(int, input().split())
    if (m, f, r) == (-1, -1, -1):
        break
    if m == -1 or f == -1:
        result.append('F')
    if m + f >= 80:
        result.append('A')
    if 80 > m + f >= 65:
        result.append('B')
    if 65 > m + f >= 50:
        result.append('C')
    if 50 > m + f >= 30:
        result.append(['D', 'C'][r >= 50])
    if 30 > m + f:
        result.append('F')
print('\n'.join(result))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# (c) midandfeed
while(1):
	m, f, r = [int(x) for x in input().split()]
	if(m+f+r == -3):
		break
	else:
		temp = m+f
		if( (m==-1) or (f==-1) ):
			print("F")
		elif (temp >= 80):
			print("A")
		elif (temp >= 65):
			print("B")			
		elif (temp >= 50):
			print("C")		
		elif (temp >= 30):
			if (f >= 50):
				print("C")
			else:
				print("D")
		else:
			print("F")