ZhenlongDai/ACPR huggingface dataset:
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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))

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
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')
        continue
    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)

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = [int(i) for i in input().split()]

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

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

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

print()

Failing test case input:
92 64 0
16 30 -1
0 2 0
-1 -1 -1

Expected output:
A
D
F


Actual output:
F
F
F
A
B
C
F
F
A
B
C
D



Fixed submission (verdict: Accepted):
while True:
    m, f, r = [int(i) for i in input().split()]

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

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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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")



Failing test case input:
92 64 -1
16 30 -2
0 0 0
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
D


Fixed submission (verdict: Accepted):
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<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>=30 and r<50):
        print("D")
    else:
        print("F")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):




while True:
    inp = input().strip().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)

Failing test case input:
81 64 -2
16 30 -1
1 4 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
D
D


Fixed submission (verdict: Accepted):




while True:
    inp = input().strip().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 < 30:
            S = "F"
        elif 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)

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
 m,f,r=map(int,input().split())
 if m==f==r==-1 : break

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

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

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

 elif 50<= (m+f) and (m+f)<60 :
   print('C')

 elif 30<=(m+f) and (m+f)<50 :
   if 50<=r :
    print('C')
   else:
    print('D')

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

Failing test case input:
20 11 -2
30 30 0
1 -1 -1
-1 -1 -1

Expected output:
D
C
F


Actual output:
D
F


Fixed submission (verdict: Accepted):
while True:
 m,f,r=map(int,input().split())
 if m==f==r==-1 : break

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

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

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

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

 elif 30<=(m+f) and (m+f)<50 :
   if 50<=r :
    print('C')
   else:
    print('D')

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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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) and (m+f<80) :
   print('B')

 elif (50<= m+f) and (m+f<60):
   print('C')

 elif (30<= m+f) and (m+f<50):
   if (50<=r):
    print('C')
   else:
    print('D')

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

Failing test case input:
40 49 -1
34 30 0
0 2 -1
-1 -1 -1

Expected output:
A
C
F


Actual output:
A
F


Fixed submission (verdict: Accepted):
while True:
 m,f,r=map(int,input().split())
 if m==f==r==-1 : break

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

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

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

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

 elif 30<=(m+f) and (m+f)<50 :
   if 50<=r :
    print('C')
   else:
    print('D')

 elif (m+f)<30 :
   print('F')
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):


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

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):


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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while(True):
	score = [int(i) for i in input().split()]
	if score[:] == [-1,-1,-1]:
		break
	score_sum = score[0] + score[1]
	if score_sum >= 80:
		print('A')
	elif 80 > score_sum >= 65:
		print('B')
	elif 65 > score_sum >= 50:
		print('C')
	elif 50 > score_sum >= 35:
		if score[2] >= 30:
			print('C')
		else :
			print('D')
	elif 30 > score_sum or score[:1] == [-1,-1]:
		print('F')

Failing test case input:
20 11 -2
30 30 0
1 -1 -1
-1 -1 -1

Expected output:
D
C
F


Actual output:
C
F


Fixed submission (verdict: Accepted):
while(True):
	score = [int(i) for i in input().split()]
	if score[:] == [-1,-1,-1]:
		break
	if score[0] == -1 or score[1] == -1:
		print('F')
	else:
		score_sum = score[0] + score[1]
		if score_sum >= 80:
			print('A')
		elif 80 > score_sum >= 65:
			print('B')
		elif 65 > score_sum >= 50:
			print('C')
		elif 50 > score_sum >= 30:
			if score[2] >= 50:
				print('C')
			else :
				print('D')
		elif 30 > score_sum:
			print('F')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r =[int(i) for i in input().split()]

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

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


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

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

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while True:
    m, f, r = [int(i) for i in input().split()]
 
    if m == f == r == -1:
        break
 
    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')
 
    elif total < 50 and r < 50:
        print('D')
 
    elif total < 65:
        print('C')
         
    elif total < 80:
        print('B')
         
    else:
        print('A')
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    a,b,c = map(int,input().split())
    if a == b == c == -1: break
    if a==-1 or b==-1: print('F')
    if 80 <= a+b: print('A')
    elif 65 <= a+b: print('B')
    elif 50 <= a+b: print('C')
    elif 30 <= a+b:
        if 50 <= c: print('C')
        else:     print('D')
    elif a+b<30: print('F')
    



Failing test case input:
20 11 -2
16 30 0
1 -1 -1
-1 -1 -1

Expected output:
D
D
F


Actual output:
D
D
F
F


Fixed submission (verdict: Accepted):
while True:
    a,b,c = map(int,input().split())
    if a == b == c == -1: break
    if a==-1 or b==-1:
        print('F')
        continue
    if 80 <= a+b:
        print('A')
        continue
    elif 65 <= a+b:
        print('B')
        continue
    elif 50 <= a+b:
        print('C')
        continue
    elif 30 <= a+b:
        if 50 <= c:
            print('C')
            continue
        else:
            print('D')
            continue
    elif a+b<30: print('F')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r = map(int,input().split())
    score = ""
    if(m == -1 and f == -1 and r == -1): break
    if(m == -1 or f == -1): score = "F"
    if(m+f >= 80): score = "A"
    elif(m+f >= 65 and m+f < 80): score = "B"
    elif(m+f >= 50 and m+f < 65): score = "C"
    elif(m+f >= 30 and m+f < 50):
        if(r >= 50): score = "C"
        else: score = "D"
    else:
        score = "F"
    print(score)
    


Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while True:
    m,f,r = map(int,input().split())
    score = ""
    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(m+f >= 65): score = "B"
    elif(m+f >= 50): score = "C"
    elif(m+f >= 30):
        if(r >= 50): score = "C"
        else: score = "D"
    else:
        score = "F"
    print(score)

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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")



Failing test case input:
20 11 -2
16 30 0
1 0 -1
-1 -1 -1

Expected output:
D
D
F


Actual output:
F
D
F


Fixed submission (verdict: Accepted):
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<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>=30 and r<50):
        print("D")
    else:
        print("F")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break

    s = m + f

    if ((m == -1 or f == -1) or (s < 30)):
        print('F')

    if 80 <= s:
        print('A')


    if 65 < s:
        print('B')

    if (50 < s) or (r <= 50):
        print('C')

    if 30 < s:
        print('D')

Failing test case input:
19 64 -2
16 10 -1
1 0 -1
-1 -1 -1

Expected output:
A
F
F


Actual output:
A
B
C
D
F
C
F
C


Fixed submission (verdict: Accepted):
while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break

    s = m + f

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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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')

Failing test case input:
81 64 -2
16 30 -1
1 0 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
C
F


Fixed submission (verdict: Accepted):
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('C') if r>49 else print('D')
 else:print('F')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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')

Failing test case input:
20 11 -2
16 30 0
1 -1 -1
-1 -1 -1

Expected output:
D
D
F


Actual output:
D
D
F
F


Fixed submission (verdict: Accepted):
m=f=r=0
while True:
    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:
        print('F')
    elif x>=80:
        print('A')
    elif 65<=x<80:
        print('B')
    elif 50<=x<65 or r>=50:
        print('C')
    else:
        print('D')
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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')

Failing test case input:
78 53 -1
0 58 -1
0 2 -1
-1 -1 -1

Expected output:
A
C
F


Actual output:
A
A
F


Fixed submission (verdict: Accepted):
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')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = [int(i) for i in input().split()]

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

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print("F")

    elif total <= 80:
        print("A")

    elif 65 <= total < 80:
        print("B")

    elif 50 <= total < 65:
        print("C")

    elif 30 <= total < 50 and r < 50:
        print("D")
        
    print()

Failing test case input:
81 64 -1
16 30 -1
1 2 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:

A

F



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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
	m, f, r = list(map(int, input().split()))
	if m == f == r ==-1:
		break
	if m == -1 or f == -1:
		print("F")
	elif m + f >= 80:
		print("A")
	elif 65 <= m + f < 80:
		print("B")
	elif 50 <= m + f < 65:
		print("C")
	elif 30 <= m + f < 50:
		if r <= 50:
			print("C")
		else:
			print("D")
	else:
		print("F")
		


Failing test case input:
20 64 -2
16 30 -1
1 1 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
C
F


Fixed submission (verdict: Accepted):
while True:
	m, f, r = list(map(int, input().split()))
	if m == f == r ==-1:
		break
	if m == -1 or f == -1:
		print("F")
	elif m + f >= 80:
		print("A")
	elif 65 <= m + f < 80:
		print("B")
	elif 50 <= m + f < 65:
		print("C")
	elif 30 <= m + f < 50:
		if r >= 50:
			print("C")
		else:
			print("D")
	else:
		print("F")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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)

Failing test case input:
20 64 -2
16 30 -1
1 1 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
F
F


Fixed submission (verdict: Accepted):
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'
    elif score >= 30:
        rank = 'D'
    else:
        rank = 'F'
    print(rank)

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while 1:
    k=input().split()
    a=int(k[0])
    b=int(k[1])
    c=int(k[2])
    if a==-1 and (b==-1 and c==-1):
        break
    if a+b<30:
        print("F")
    elif a+b<50:
        if c>=50:
            print("C")
        else:
            print("D")
    elif a+b<65:
        print("C")
    elif a+b<80:
        print("B")
    else:
        print("A")
        


Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while 1:
    k=input().split()
    a=int(k[0])
    b=int(k[1])
    c=int(k[2])
    if a==-1 and (b==-1 and c==-1):
        break
    if a<0 or b<0:
        print("F")
    elif a+b<30:
        print("F")
    elif a+b<50:
        if c>=50:
            print("C")
        else:
            print("D")
    elif a+b<65:
        print("C")
    elif a+b<80:
        print("B")
    else:
        print("A")

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = map(int, input().split())
    A = m + f
    if m == f == r == -1:
        break
    elif m == 0 or f == 0:
        print('F')
    elif A >= 80:
        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')
    else:
        print('F')

Failing test case input:
78 53 -1
0 58 -1
0 2 -1
-1 -1 -1

Expected output:
A
C
F


Actual output:
A
F
F


Fixed submission (verdict: Accepted):
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:
        if 50 <= r:
            print('C')
        else:
            print('D')
    else:
        print('F')
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r  = [int(_) for _ in input().split()]
    if m == f == r == -1:
        break

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


Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while True:
    m, f, r  = [int(_) for _ in input().split()]
    if m == f == r == -1:
        break

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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = map(int, input().split())
    if m==f==r==-1:
        break
    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')


Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
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 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')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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")

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while True:
    z=list(map(int,input().split()))
    if z == [-1,-1,-1]:
        break
    if z[0]==-1 or z[1]==-1:
        print('F')
    elif 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")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = map(int, input().split())
    if m == f == r== -1:
        break
    s = m + f
    
    if s >= 80:
        print("A")
    elif s >= 65 and s < 80:
        print("B")
    elif (s >= 50 and s < 65) or r >= 50:
        print("C")
    elif s >= 30 and s < 50:
        print("D")
    else:
        print("F")
    




Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = map(int, input().split())
    if m == f == r== -1:
        break
    s = m + f
    
    if s >= 80:
        print("A")
    elif s >= 65:
        print("B")
    elif s >= 50:
        print("C")
    elif s >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")
    




Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r = map(int,input().split())
    
    if m == f == r == -1:
        break
    elif m + f >= 80:
        print("A")
    elif 65 <= m + f < 80:
        print("B")
    elif 50 <= m + f < 65:
        print("C")
    elif 30 <= m+ f < 50 and r < 50:
        print("D")
        if r >= 50:
            print("C")
    elif m+f < 30:
        print("F")
    elif m == -1 or f == -1:
        print("F")


Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
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")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
A=[]
while True:
	
	
	
	m,f,r = [int(i) for i in input().split()]
	if m == f == r == -1:
		break
	elif m+f >= 80:
		A.append('A')
	elif 65<=m+f<80:
		A.append('B')
	elif 50<=m+f<65:
		A.append('C')
	elif (30<=m+f<50) and (50<=r):
		A.append('D')
	else:
		A.append('F')

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

Failing test case input:
92 64 -1
13 32 -1
1 1 0
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
F
F


Fixed submission (verdict: Accepted):
A=[]
while True:
	
	
	
	m,f,r = [int(i) for i in input().split()]
	if m == f == r == -1:
		break
	elif m==-1 or f==-1:
		A.append('F')	
	elif m+f >= 80:
		A.append('A')
	elif 65<=m+f<80:
		A.append('B')
	elif (50<=m+f<65) or ((30<=m+f<50) and (50<=r)):
		A.append('C')
	elif (30<=m+f<50):
		A.append('D')
	else:
		A.append('F')

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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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")


Failing test case input:
0 22 -2
50 30 -1
-1 2 -2
-1 -1 -1

Expected output:
F
A
F


Actual output:
F
A
F
F


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



    sum = value[0] + value[1]

    if value[0] == -1 or value[1] == -1:
        print("F")
    elif 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")

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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")

Failing test case input:
73 64 -1
16 30 -1
1 2 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
A


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

    elif r>=50:
        print("C")

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

    else:
        print("F")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r =[int(i) for i in input().split()]

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

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

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

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

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


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

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while True:
    m, f, r = [int(i) for i in input().split()]
 
    if m == f == r == -1:
        break
 
    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')
 
    elif total < 50 and r < 50:
        print('D')
 
    elif total < 65:
        print('C')
         
    elif total < 80:
        print('B')
         
    else:
        print('A')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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")


Failing test case input:
0 22 -1
17 30 0
-2 2 -2
-1 -1 -1

Expected output:
F
D
F


Actual output:
F
F
F


Fixed submission (verdict: Accepted):
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")

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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")

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
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 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")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = list(map(int,input().split()))
    if (m == -1) & (f == -1) & (r == -1):
        break
    if (m + f) < 30 | m == -1 | f == -1:
        print("F")
    elif (m + f) < 50 & r < 50:
        print("D")
    elif (m + f) < 65:
        print("C")
    elif (m + f) < 80:
        print("B")
    else:
        print("A")

Failing test case input:
40 64 -3
11 30 -1
0 2 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
C
C


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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    a,b,c = map(int,input().split())
    if a == b == c == -1: break
    if a==-1 or b==-1: print('f')
    if 80 <= a+b: print('A')
    elif 65 <= a+b: print('B')
    elif 50 <= a+b: print('C')
    elif 30 <= a+b:
        if 50 <= c: print('C')
        else:     print('D')
    elif a+b<30: print('F')
    



Failing test case input:
20 11 -2
30 30 0
1 -1 -1
-1 -1 -1

Expected output:
D
C
F


Actual output:
D
C
f
F


Fixed submission (verdict: Accepted):
while True:
    a,b,c = map(int,input().split())
    if a == b == c == -1: break
    if a==-1 or b==-1:
        print('F')
        continue
    if 80 <= a+b:
        print('A')
        continue
    elif 65 <= a+b:
        print('B')
        continue
    elif 50 <= a+b:
        print('C')
        continue
    elif 30 <= a+b:
        if 50 <= c:
            print('C')
            continue
        else:
            print('D')
            continue
    elif a+b<30: print('F')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break

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

Failing test case input:
20 64 -2
16 30 0
1 0 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
B
D
F


Fixed submission (verdict: Accepted):
while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')
    elif total < 50 and r < 50:
        print('D')
    elif total < 65:
        print('C')
    elif total < 80:
        print('B')
    else:
        print('A')
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r = list(map(int, input().split()))
    
    if (m==-1 & f == -1 & r==-1):
        break
        
    
    if (m == -1 | 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 <= 50):
        if (r >= 50):
            print ("C")
        else:
            print ("D")
    
    elif (m+f<30):
        print ("F")

Failing test case input:
81 64 -1
16 30 -1
1 2 -1
-1 -1 -1

Expected output:
A
D
F


Actual output:
A
D
D


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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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")

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


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

    elif r>=50:
        print("C")

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

    else:
        print("F")

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = [int(i) for i in input().split()]

    total = m + f
    
    if m == f == r == -1:
        break
        
    elif m == -1 or f == -1 or total < 30:
        print("F")

    elif 65 <= total or total < 80:
        print("B")

    elif 50 <= total or total < 65:
        print("C")

    elif 30 <= total or total < 50 and r < 50:
        print("D")

    else:
        print("A")

    print()

Failing test case input:
40 53 -1
0 7 -1
0 1 -2
-1 -1 -1

Expected output:
A
F
F


Actual output:
B

F

F



Fixed submission (verdict: Accepted):
while True:
   m, f, r = [int(i) for i in input().split()]
  
   if m == f == r == -1:
      break
   total = m + f
   if m == -1 or f == -1 or total < 30:
      print("F")
    
   elif total < 50 and r < 50:
      print("D")
 
   elif r >= 50 or total < 65:
      print("C")
    
   elif total < 80:
      print("B")
 
   else:
      print("A")
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r = list(map(int, input().split()))
    
    if (m==-1 & f == -1 & r==-1):
        break
        
    
    if (m == -1 | f == -1):
        print ("F")
    
    elif (m + f >= 80):
        print ("A")
    
    elif (m+f >= 65):    
        print ("B")
    
    elif (m+f >= 65):
        print ("C")
    
    elif (m+f >= 30):
        if (r >= 50):
            print ("C")
        else:
            print ("D")
    
    elif (m+f<30):
        print ("F")

Failing test case input:
20 11 -2
30 30 0
1 -1 -1
-1 -1 -1

Expected output:
D
C
F


Actual output:
D
D
F


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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
  m,r,f = 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")


Failing test case input:
40 53 -1
20 6 -2
0 2 -1
-1 -1 -1

Expected output:
A
F
F


Actual output:
F
F
F


Fixed submission (verdict: Accepted):
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")

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r =[int(i) for i in input().split()]

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

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

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while True:
    m, f, r = [int(i) for i in input().split()]
 
    if m == f == r == -1:
        break
 
    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')
 
    elif total < 50 and r < 50:
        print('D')
 
    elif total < 65:
        print('C')
         
    elif total < 80:
        print('B')
         
    else:
        print('A')
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):

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

Failing test case input:
78 53 -1
0 58 -1
0 2 -1
-1 -1 -1

Expected output:
A
C
F


Actual output:
C
F
F


Fixed submission (verdict: Accepted):

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 30<=s<50 and 50<=r else 'B' if 65<=s<80 else 'A')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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')

Failing test case input:
0 64 -1
16 30 -1
0 2 -2
-1 -1 -1

Expected output:
C
D
F


Actual output:
F
D
F


Fixed submission (verdict: Accepted):
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')

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m,f,r =[int(i) for i in input().split()]

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

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

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

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

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

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

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
F
B
F


Fixed submission (verdict: Accepted):
while True:
    m, f, r = [int(i) for i in input().split()]
 
    if m == f == r == -1:
        break
 
    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')
 
    elif total < 50 and r < 50:
        print('D')
 
    elif total < 65:
        print('C')
         
    elif total < 80:
        print('B')
         
    else:
        print('A')
Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    m, f, r = map(int, input().split())
    sum_score = m + f
    if m != -1 and f != -1:
        if sum_score >= 80:
            print("A")
        elif 65 <= sum_score < 80:
            print("B")
        elif 50 <= sum_score < 65:
            print("C")
        elif 30 <= sum_score < 50:
            if r >= 50:
                print("C")
            else:
                print("D")
        else:
            print("D")
    else:
        if m == -1 or f == -1:
            if m == -1 and f == -1 and r == -1:
                break
        else:
            print("F")



Failing test case input:
40 42 -1
20 30 -1
0 2 -1
-1 -1 -1

Expected output:
A
C
F

Actual output:
A
C
D


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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
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')

Failing test case input:
86 -1 0
22 57 -1
0 2 -2
-1 -1 -1

Expected output:
F
B
F


Actual output:
A
B
F


Fixed submission (verdict: Accepted):
while True:
    m, f, r = map(int, input().split())

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

Problem: p02411
Buggy submission (Python3, verdict: Wrong Answer):
while 1:
    a, b, c = map(int, input().split())
    if a == b == c == -1:
        break
    if a == -1 or b == -1 or a + b < 30: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')
    
    


Failing test case input:
40 10 -1
16 30 -1
0 4 -1
-1 -1 -1

Expected output:
C
D
F


Actual output:
C
F


Fixed submission (verdict: Accepted):
while 1:
    a, b, c = map(int, input().split())
    if a == b == c == -1:
        break
    if a == -1 or b == -1 or a + b < 30: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('C')
    else:print('D')