qyliang/CodeNanoFix huggingface dataset:
Buggy 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) 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)
    else:
        print(F)


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


Fixed code:
while True:
  m,f,r = map(int, input().split())
  if m == -1 & f == -1 & 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")
Buggy code:
for _ in [None] * 50:
    m, f, r = map(int, input().split())
    result = " "
    if m == f == r == -1:
        break
    if m == -1 or f == -1 or m + f < 30:
        result = "F"
    elif m + f > 80:
        result = "A"
    elif 80 > m + f >= 65:
        result = "B"
    elif 65 > m + f >= 50:
        result = "C"
    else:
        result = "C" if r >= 50 else result = "D"
    print(result)



Fixed code:
for _ in [None] * 50:
    m, f, r = map(int, input().split())
    result = ""
    if m == f == r == -1:
        break
    if m == -1 or f == -1 or m + f < 30:
        result = "F"
    elif m + f >= 80:
        result = "A"
    elif 80 > m + f >= 65:
        result = "B"
    elif 65 > m + f >= 50:
        result = "C"
    else:
        result = "C" if r >= 50 else "D"
    print(result)
Buggy code:
while True:
    m, f, v = [int(n) for n in input().split()]

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

Fixed code:
while True:
    m, f, v = [int(n) for n in input().split()]

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

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

Fixed code:
while True:
    m, f, r = map(int, input().split())
    if (m, f, r) == (-1, -1, -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 30 > m + f:
        print('F')
Buggy 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)

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

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

Fixed code:
while True:
    m, f, r = map(int, input().split())
    if (m, f, r) == (-1, -1, -1):
        break
    if m == -1 or f == -1:
        print("F")
    elif m+f >= 80:
        print("A")
    elif m+f >= 65 and m+f < 80:
        print("B")
    elif m+f >= 50 and m+f < 65:
        print("C")
    elif m+f >= 30 and m+f < 50:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")
Buggy code:
midScore =[0]*50
finScore = [0]*50
reScore = [0]*50
personNum = 0
while True:
    m,f,r = map(int,input().split())
    if m is f is r is -1:
        break
    midScore[personNum] = m
    finScore[personNum] = f
    reScore[personNum] = r
    personNum += personNum
    
for person in range(personNum+1):
    totalScore = midScore[person] + finScore[person]
    if midScore[person] == -1 or finScore[person] == -1:
        print("F")
    elif 80<=totalScore:
        print("A")
    elif 65<=totalScore<80:
        print("B")
    elif 50<=totalScore<65:
        print("C")
    elif 30<=totalScore<50:
        if 50<=reScore:
            print("C")
        else:
            print("D")
    elif totalScore<30:
        print("F")


Fixed code:
midScore =[0]*50
finScore = [0]*50
reScore = [0]*50
personNum = 0
while True:
    m,f,r = map(int,input().split())
    midScore[personNum] = m
    finScore[personNum] = f
    reScore[personNum] = r
    personNum += 1
    if m is f is r is -1:
        break
    
    
for person in range(personNum):
    totalScore = midScore[person] + finScore[person]
    if midScore[person] is finScore[person] is reScore[person] is -1:
        pass
    elif midScore[person] == -1 or finScore[person] == -1:
        print("F")
    elif 80<=totalScore:
        print("A")
    elif 65<=totalScore<80:
        print("B")
    elif 50<=totalScore<65:
        print("C")
    elif 30<=totalScore<50:
        if 50<=reScore[person]:
            print("C")
        else:
            print("D")
    elif totalScore<30:
        print("F")
Buggy code:
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')
~                 

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


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

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

Fixed code:
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')
Buggy code:
while True:
    a = input().split(' ')
    if a[0] == '-1' and a[1] == '-1' and a[2] == '-1':
        break
    elif int(a[0]) or int(a[1]) == -1:
        print('F')
    elif int(a[0]) + int(a[1]) >= 80:
        print('A')
    elif 65 <= int(a[0]) + int(a[1]) < 80:
        print('B')
    elif 50 <= int(a[0]) + int(a[1]) < 65:
        print('C')
    elif 30 <= int(a[0]) + int(a[1]) < 50:
        if int(a[2]) >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')

Fixed code:
while True:
    a = input().split(' ')
    if a[0] == '-1' and a[1] == '-1' and a[2] == '-1':
        break
    elif int(a[0]) == -1 or int(a[1]) == -1:
        print('F')
    elif int(a[0]) + int(a[1]) >= 80:
        print('A')
    elif 65 <= int(a[0]) + int(a[1]) < 80:
        print('B')
    elif 50 <= int(a[0]) + int(a[1]) < 65:
        print('C')
    elif 30 <= int(a[0]) + int(a[1]) < 50:
        if int(a[2]) >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')
Buggy code:
while(1):
	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')

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


Fixed 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")
Buggy code:
while True:
    m, f, r = map(int, input().split())
    A = m + f + r
    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:
        print('D')
    else:
        print('F')

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

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

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

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

   total = m + f
   if m == -1 or == -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') 

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

Fixed code:
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    elif m==-1 or f==-1:
        print("F")
    else:
        s=m+f
        if s>=80:
            print("A")
        if 65<=s<80:
            print("B")
        if 50<=s<65:
            print("C")
        if 30<=s<50:
            if r>=50:
                print("C")
            else:
                print("D")
        if s<30:
            print("F")
Buggy code:
l = []
while True:
  m,f,r = map(int,input().split())
  if m == f == r == -1:
    break
  else:
    l.append([m,f,r])
for i in l:
  s = ''
  x = i[0] + i[1]
  if i[0] == -1 or i[1] == -1:
    s = 'F'
  elif x >= 80:
    s = 'A'
  elif x >= 65:
    s = 'B':
  elif x >= 50:
    s = 'C':
  elif x >= 30:
    s = 'D'
    if i[2] >= 50:
      s = 'C'
  else:
    s = 'F'
  print(s)

Fixed code:
def code():
	l = []
	while True:
		m,f,r = map(int,input().split())
		if m == f == r == -1:
			break
		else:
			l.append([m,f,r])
	for i in l:
		s = ''
		x = i[0]+i[1]
		if i[0] == -1 or i[1] == -1:
			s = 'F'
		elif x >= 80:
			s = 'A'
		elif x >= 65:
			s = 'B'
		elif x >= 50:
			s = 'C'
		elif x >= 30:
			s = 'D'
			if i[2] >= 50:
				s = 'C'
		else:
			s = 'F'
		print(s)
code()
Buggy code:
import sys

while True:
    n = sys.stdin.readline()[:-1]

    if n = '-1 -1 -1':
        break

    marks = [ int(m) for m in n.split() ]

    mt_points,retest = marks[0] + marks[1],marks[2]

    if -1 in marks[:-1]:
        print('F')
        continue
    elif mt_points >= 80:
        print('A')
        continue
    elif mt_points >= 65 and 80 > mt_points:
        print('B')
        continue
    elif mt_points >= 50 and 65 > mt_points:
        print('C')
        continue
    elif mt_points >= 30 and 50 > mt_points:
        if retest >= 50:
            print('C')
            continue
        print('D')
        continue
    elif 30 > mt_points:
        print('F')


Fixed code:
import sys

while True:
    n = sys.stdin.readline()[:-1]

    if n == '-1 -1 -1':
        break

    marks = [ int(m) for m in n.split() ]

    mt_points,retest = marks[0] + marks[1],marks[2]

    if -1 in marks[:-1]:
        print('F')
        continue
    elif mt_points >= 80:
        print('A')
        continue
    elif mt_points >= 65 and 80 > mt_points:
        print('B')
        continue
    elif mt_points >= 50 and 65 > mt_points:
        print('C')
        continue
    elif mt_points >= 30 and 50 > mt_points:
        if retest >= 50:
            print('C')
            continue
        print('D')
        continue
    elif 30 > mt_points:
        print('F')
Buggy code:
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')
????????????????????

Fixed code:
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')
Buggy code:
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')
          

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

while True:
    inp = input()
    a = inp.split()
    a[0] = int(a[0])
    a[1] = int(a[1])
    a[2] = int(a[2])
    if a[0] == -1 and a[1] == -1 and a[2] == -1:
        break
    else:
        b.append(a)

for i in b:
    if i[0] == -1 or 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:
        print("D")
    elif i[2] >= 50:
        print("C")
    else:
        print("F")


Fixed code:
b = []

while True:
    inp = input()
    a = inp.split()
    a[0] = int(a[0])
    a[1] = int(a[1])
    a[2] = int(a[2])
    if a[0] == -1 and a[1] == -1 and a[2] == -1:
        break
    else:
        b.append(a)

for i in b:
    if i[0] == -1 or 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:
        print("F")
    elif i[2] >= 50:
        print("C")
    else:
        print("D")
Buggy code:
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 or r >= 50:
        print('C')
        
    elif total < 80:
        print('B')

    else:
        print('A')
        

Fixed code:
while True:
	[m, f, r] = [int(i) for i in input().split()]
	
	if m == -1 and f == -1 and r == -1:
		break
		
	elif m == -1 or f == -1:
		print('F')
			
	elif m + f >= 80:
		print('A')
	elif 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 < 50:
		print('D')
	else:
		print('F')