qyliang/CodeNanoFix huggingface dataset:
Buggy code:
# def f(As, M):
#     prev = None
#     c = 0
#
#     for i, A in enumerate(As):
#         A %= M
#         if i == 0:
#             prev = {A: 1}
#             if A == 0:
#                 c += 1
#             continue
#
#         ccc = {A: 1}
#         for k in prev.keys():
#             v = prev[k]
#             newv = (k + A) % M
#             if newv in ccc:
#                 ccc[newv] += v
#             else:
#                 ccc[newv] = v
#         c += ccc[0] if 0 in ccc else 0
#         prev = ccc
#     return c
def f(As, M):
    res = 0
    totals = [As[0] % M]
    for A in As[1:]:
        l = (totals[-1] + A) % M
        if l == 0:
            res += 1
        totals.append(l)

    # N = len(As)

    ddd = {}
    for t in totals:
        if t not in ddd:
            ddd[t] = 0
        res += ddd[t]
        ddd[t] += 1

    # for i in range(N):
    #     ii = totals[N - 1 - i]
    #     if ii == 0:
    #         res += 1
    #     for j in range(i + 1, N):
    #         jj = totals[N - 1 - j]
    #
    #         if jj == ii:
    #             res += 1
    return res


def main():
    N, M = [int(a) for a in input().split()]
    As = [int(a) for a in input().split()]
    print(f(As, M))


if __name__ == '__main__':
    main()


Fixed code:
# def f(As, M):
#     prev = None
#     c = 0
#
#     for i, A in enumerate(As):
#         A %= M
#         if i == 0:
#             prev = {A: 1}
#             if A == 0:
#                 c += 1
#             continue
#
#         ccc = {A: 1}
#         for k in prev.keys():
#             v = prev[k]
#             newv = (k + A) % M
#             if newv in ccc:
#                 ccc[newv] += v
#             else:
#                 ccc[newv] = v
#         c += ccc[0] if 0 in ccc else 0
#         prev = ccc
#     return c
def f(As, M):
    totals = [As[0] % M]
    res = 1 if As[0] % M == 0 else 0
    for A in As[1:]:
        l = (totals[-1] + A) % M
        if l == 0:
            res += 1
        totals.append(l)

    # N = len(As)

    ddd = {}
    for t in totals:
        if t not in ddd:
            ddd[t] = 0
        res += ddd[t]
        ddd[t] += 1

    # for i in range(N):
    #     ii = totals[N - 1 - i]
    #     if ii == 0:
    #         res += 1
    #     for j in range(i + 1, N):
    #         jj = totals[N - 1 - j]
    #
    #         if jj == ii:
    #             res += 1
    return res


def main():
    N, M = [int(a) for a in input().split()]
    As = [int(a) for a in input().split()]
    print(f(As, M))


if __name__ == '__main__':
    main()
Buggy code:
N,M=list(map(int,input().split()))
A=list(map(int,input().split()))
C=[]
for i in range(len(A)):
    if i == 0:
        C.append(0)
    else:
        C.append(C[i-1]+A[i])

mod=[]
for i in range(len(C)):
    mod.append(C[i]%M)

k=0
mod.sort()
print(mod)
for i in range(1,len(mod)):
    if mod[i]==0:
        k+=1
n=1
t=0
for i in range(1,len(mod)):
    if i < len(mod)-1:
        if mod[i-1]==mod[i]:
            n+=1
        elif n>=2:
            t+=int(n*(n-1)/2)
            n=1
        else:
            pass
    else:
        if n>=2:
            if mod[i-1]==mod[i]:
                n+=1
            else:
                pass
            t+=int(n*(n-1)/2)
        else:
            if mod[i-1]==mod[i]:
                t+=1
            else:
                pass

print(k+t+1)



Fixed code:
N,M=list(map(int,input().split()))
A=list(map(int,input().split()))

C=[0]
for i in range(len(A)):
    C.append(C[i]+A[i])

mod=[]
for i in range(len(C)):
    mod.append(C[i]%M)

mod.sort()

n=1
t=0
for i in range(1,len(mod)):
    if i < len(mod)-1:
        if mod[i-1]==mod[i]:
            n+=1
        elif n>=2:
            t+=int(n*(n-1)/2)
            n=1
        else:
            pass
    else:
        if n>=2:
            if mod[i-1]==mod[i]:
                n+=1
            else:
                pass
            t+=int(n*(n-1)/2)
        else:
            if mod[i-1]==mod[i]:
                t+=1
            else:
                pass

print(t)
Buggy code:
from collections import defaultdict
N, M = map(int, input().split())
A = list(map(int, input().split()))

d = defaultdict(int)
ans = 0
s = 0
d[0] = 1
for i, a in enumerate(A):
    a %= M
    s += a
    ans += d[s%M]
    d[s % M] += 1

print(ans, d)

Fixed code:
from collections import defaultdict
N, M = map(int, input().split())
A = list(map(int, input().split()))

d = defaultdict(int)
ans = 0
s = 0
d[0] = 1
for i, a in enumerate(A):
    a %= M
    s += a
    ans += d[s%M]
    d[s % M] += 1

print(ans)
Buggy code:
# coding: utf-8
# Your code here!

import collections

n,m=[int(i) for i in input().split()]
A=[int(i) for i in input().split()]

S=[0]*(n+1)
for i in range(n):
    S[i+1]=(S[i]+A[i])%m

c = collections.Counter(S)

ans=0
for i in c:
    ans+=c[i]*(c[i]-1)//2

print(c)
print(ans)    
    

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

import collections

n,m=[int(i) for i in input().split()]
A=[int(i) for i in input().split()]

S=[0]*(n+1)
for i in range(n):
    S[i+1]=(S[i]+A[i])%m

c = collections.Counter(S)

ans=0
for i in c:
    ans+=c[i]*(c[i]-1)//2

#print(c)
print(ans)
Buggy code:
N, M = map(int, input().split())
*A, = map(int, input().split())
C = {0: 1}
ans = 0
s = 0
for a in A:
    s = (s + a) % M
    ans += C.get(s, 0)
    C[s] = C.get(s, 0) + 1
    print("C is {}, ans is {}".format(C,ans))
print(ans)

Fixed code:
N, M = map(int, input().split())
*A, = map(int, input().split())
C = {0: 1}
ans = 0
s = 0
for a in A:
    s = (s + a) % M
    ans += C.get(s, 0)
    C[s] = C.get(s, 0) + 1
print(ans)
Buggy code:
r = input()

if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  print("AGC")

Fixed code:

r = int(input())
if(r < 1200):
  print("ABC")
elif(r < 2800):
  print("ARC")
else:
  print("AGC")
Buggy code:
A=int(input())
ARC=1
if(A<1200):
  print("ABC")
  ARC=0

if(A>=2800):
  print("AGC")
  ARC=0
  
if(ARC=1):
  print("ARC")


Fixed code:
A=int(input())
ARC=1
if(A<1200):
  print("ABC")
  ARC=0

if(A>=2800):
  print("AGC")
  ARC=0
  
if(ARC==1):
  print("ARC")
Buggy code:
R = int(input())
if R < 1200:
  print(ABC)
elif R < 2800:
  print(ARC)
else:
  print(AGC)

Fixed code:
R=int(input())

if R<1200:
    print('ABC')
elif R<2800:
    print('ARC')
else :
    print('AGC')
Buggy code:
r=input()
if r<1200:
  print('ABC')
elif 1200<=r<2800:
  print('ARC')
else:
  print('AGC')

Fixed code:
r = int(input())

if (r < 1200):
    print("ABC")
elif (r < 2800):
    print("ARC")
else:
    print("AGC")
Buggy code:
x = int(input())
l0 = [1200,2800,9999]
l1 = ["ABC","ARC","AGC"]

for i in range(3):
  if x < l0[i]:
    print(l1[1])
    break


Fixed code:
x = int(input())
l0 = [1200,2800,9999]
l1 = ["ABC","ARC","AGC"]

for i in range(3):
  if x < l0[i]:
    print(l1[i])
    break
Buggy code:
R = input()

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Fixed code:
R = int(input())

if R<1200 :
    print("ABC")
elif R<2800 :
    print("ARC")
else:
    print("AGC")
Buggy code:
import sys
r=int(input())
if r<1200:
	print("ABC")
	sys.exit()
elif r<2800:
	print("ARC")
	sys.exit()
else:
	print("R")

Fixed code:
import sys
r=int(input())
if r<1200:
	print("ABC")
	sys.exit()
elif r<2800:
	print("ARC")
	sys.exit()
else:
	print("AGC")
Buggy code:
r = int(input())
if r >= 2800:
    print('AGC')
else:
    if r <= 1200:
        print('ABC')
    else:
        print('ARC')

Fixed code:
r = int(input())
if r >= 2800:
    print('AGC')
else:
    if r < 1200:
        print('ABC')
    else:
        print('ARC')
Buggy code:

def main():
    n = int(input())
    if n <= 1200:
        print('ABC')
    elif 1200 < n <= 2800:
        print('ARC')
    else:
        print('AGC')


if __name__ == "__main__":
    main()


Fixed code:

def main():
    n = int(input())
    if n < 1200:
        print('ABC')
    elif 1200 <= n < 2800:
        print('ARC')
    else:
        print('AGC')


if __name__ == "__main__":
    main()
Buggy code:
n = int(input())
if n<1200:
    print('ABC')
if 1200<=n<2800:
    print('ARC')
else :
    print('AGC')

Fixed code:
n = int(input())
if n<1200:
    print('ABC')
elif 1200<=n<2800:
    print('ARC')
else :
    print('AGC')
Buggy code:
R = input()
if R < 1200:
	print('ABC')
elif R < 2800:
	print('ARC')
else:
	print('AGC')


Fixed code:
R = int(input())
if R<1200:
        print("ABC")
elif R<2800:
        print("ARC")
else:
        print("AGC")
Buggy code:
r=int(input())
if r<1200:
  print("ABC")
if 1200<=r<2800:
  print("ARC")
else:
  print("AGC")

Fixed code:

r = int(input())
if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')
Buggy code:
R = int(input())
if R < 1200:
    print('ABC')
elif:
    R < 2800:
    print('ARC')
else:
    print('AGC')


Fixed code:
R = int(input())

if R < 1200:
    print("ABC")
elif 1200 <= R and R < 2800:
    print("ARC")
else:
    print("AGC")
Buggy code:
a = int(input()) 
A=['ABC','ARC','AGC']
if a <1200:
  print(A[0])
if a <2800:
  print(A[1])
else:
  print(A[2])

Fixed code:
a = int(input()) 
A=['ABC','ARC','AGC']
if a <1200:
  print(A[0])
elif a <2800:
  print(A[1])
else:
  print(A[2])
Buggy code:
r = int(input())
print("ABC" if r < 1200 else "AGC" if r < 2800 else"AGC")

Fixed code:
r = int(input())
print("ABC" if r < 1200 else "ARC" if r < 2800 else "AGC")
Buggy code:
R = int(input(R))
if R < 1200:
  print('ABC')
elif 1200 <= R < 2800:
  print('ARC')
else:
  print('AGC')

Fixed code:
R=int(input())
if (R<1200):
  print('ABC')
elif(R<2800):
  print('ARC')
else:print('AGC')
Buggy code:
r = int(input())
if n < 1200:
    print('ABC')
elif n < 2800:
    print('ARC')
else:
    print('AGC')

Fixed code:
n = int(input())
if n < 1200:
    print("ABC")
elif n < 2800:
    print("ARC")
else:
    print("AGC")
Buggy code:
r = int(input())
if r <= 1200:
  print("ABC")
elif r <= 2800:
  print("ARC")
else:
  print("AGC")


Fixed code:
r = int(input())
contest = ''
if r < 1200:
	contest = 'ABC'
elif r < 2800:
	contest = 'ARC'
else:
	contest = 'AGC'
print(contest)
Buggy code:
rate=input()
result=""
if rate<1200:
  result="ABC"
elif rate<2800:
  result="ARC"
else:
  result="AGC"
print(result)

Fixed code:
rate=int(input())
result=""
if rate<1200:
  result="ABC"
elif rate<2800:
  result="ARC"
else:
  result="AGC"
print(result)
Buggy code:
def main():
    from sys import stdin, setrecursionlimit
    setrecursionlimit(10**6)
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]

    r = int(r)
    if r < 1200:
        print('ABC')
    elif r < 2800
        print('ARC')
    else:
        print('AGC')

if __name__ == '__main__':
    main()



Fixed code:
def main():
    from sys import stdin, setrecursionlimit
    setrecursionlimit(10**6)
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]

    r = int(r)
    if r < 1200:
        print('ABC')
    elif r < 2800:
        print('ARC')
    else:
        print('AGC')

if __name__ == '__main__':
    main()
Buggy code:
R = input()
if R < 1200:
    print("ABC")
elif R<2800:
    print("ARC")
else:
    print("AGC")

Fixed code:

R = int(input())
if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")
Buggy code:
R = int(input())
if R > 1200:
  if R > 2800:
    print("AGC")
  else:
    print("ARC")
else:
  print("ABC")

Fixed code:
R=int(input())
if(1200>R):
    print("ABC")
elif(2800>R):
    print("ARC")
else:
    print("AGC")
Buggy code:
import sys

r = map(int, sys.stdin.readline().rstrip())

def main():
    if r < 1200:
        return 'ABC'
    elif r < 2800:
        return 'ARC'
    else:
        return 'AGC'

if __name__ == '__main__':
    ans = main()
    print(ans)

Fixed code:
import sys

r = int(sys.stdin.readline().rstrip())

def main():
    if r < 1200:
        return 'ABC'
    elif r < 2800:
        return 'ARC'
    else:
        return 'AGC'

if __name__ == '__main__':
    ans = main()
    print(ans)
Buggy code:
R = int(input())
if R < 1200:
  print("ABC")
else:
    if R < 2800:
    print("ARC")
  else:
    print("AGC")
  

Fixed code:
R = int(input())
if R < 1200:
  print("ABC")
else:
  if R < 2800:
    print("ARC")
  else:
    print("AGC")
Buggy code:
a=int(input())
if(a<1200):
  print("ABC")
 elif a<2800:
  print("ARC")
 else:
  print("AGC")
  

Fixed code:
a = int(input())
if a<1200:
    print ("ABC")
elif 1199 < a < 2800:
    print ("ARC")
else:
    print("AGC")
Buggy code:
from sys import stdin
n = int(stdin.readline.rstrip())
if n<1200:
  print('ABC')
elif n>=1200 and n<2800:
  print('ARC')
elif n>=2800:
  print('AGC')

Fixed code:
from sys import stdin
n = int(stdin.readline().rstrip())
if n<1200:
  print('ABC')
elif n>=1200 and n<2800:
  print('ARC')
elif n>=2800:
  print('AGC')
Buggy code:
R=input()
if R<1200:
  print("ABC")
elif R>=1200 and R<2800:
  print("ARC")
elif R>=2800:
  print("AGC")

Fixed code:
R=int(input())
if R<1200:
  print("ABC")
elif R>=1200 and R<2800:
  print("ARC")
elif R>=2800:
  print("AGC")
Buggy code:
r = int(input())
if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  print("ABC")

Fixed code:
r = int(input())
if r<1200:
    print('ABC')
elif r <2800:
    print('ARC')
else:
    print('AGC')
Buggy code:
r=int(input())
data=(1200,2800)
name=('ABC', 'ARC', 'AGC')
z=[name[0] if r < data[0] else name[1] if data[0] <= r < data[1] else name(2) if data[1] <= r else i for i in range(1)]
print(z[0])


Fixed code:
r=int(input())
data=(1200,2800)
name=('ABC', 'ARC', 'AGC')

[print(name[0]) for i in range(1) if r < 1200]
[print(name[1]) for i in range(1) if 1200 <= r < 2800 ]
[print(name[2]) for i in range(1) if 2800 <=r ]
Buggy code:
r=int(input())
data1=1200
dara2=2800
name=('ABC', 'ARC', 'AGC')
if r<data1:
  print(name[0])
elif data1<=r<data2:
  print(name[1])
else:
  print(name[2])
  



Fixed code:
r=int(input())
data1=1200
dara2=2800
name=('ABC', 'ARC', 'AGC')
if r<data1:
  print(name[0])
elif data1<=r<2800:
  print(name[1])
else:
  print(name[2])
Buggy code:
r=int(input())
data=(1200,2800)
name=('ABC', 'ARC', 'AGC')
if r<data[0]:
  print(name[0])
if data[0]<=r<data[1]:
  print(name[1])
else:
  print(name[2])



Fixed code:
r=int(input())

name=('ABC', 'ARC', 'AGC')
if r<1200:
  print(name[0])
elif 1200<=r<2800:
  print(name[1])
else:
  print(name[2])
Buggy code:
r = int(input())
if r < 1200:
  print(ABC)
elif 1200 <= r < 2800:
  print(ARC)
else:
  print(AGC)

Fixed code:
r = int(input())

if (r < 1200):
	print ("ABC")
elif (r < 2800):
	print ("ARC")
else:
	print ("AGC")
Buggy code:
r = input()
if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  print("AGC")
  

Fixed code:
r = int(input())
if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  print("AGC")
Buggy code:
r=int(input())
if r<1200:
    print("ABC")
if r<2800:
    print("ARC")
else:
    print("AGC")

Fixed code:
r = int(input())

if r < 1200:
	print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')
Buggy code:
R = int(input())

if R < 1200:
    print('ABC')
elif 1200 <= R < 2800
    print('ARC')
else:
    print('AGC')

Fixed code:
R = int(input())

if(R<1200):
  print("ABC")
elif(R<2800):
  print("ARC")
else:
  print("AGC")
Buggy code:
K=int(input());print('ABC'(K<1200)or'ARC'(K<2800)or'AGC')

Fixed code:
K=int(input());print('ABC'*(K<1200)or'ARC'*(K<2800)or'AGC')
Buggy code:
n = int(input())
if n <=1200:print("ABC")
elif n<=2800:print("ARC")
else:print("AGC")

Fixed code:
n = int(input())
if n <1200:print("ABC")
elif n<2800:print("ARC")
else:print("AGC")
Buggy code:
r=int(input())
print("ABC" if r<1200 else "ABC" if r <2800 else "AGC")

Fixed code:
r=int(input())
print("ABC" if r<1200 else "ARC" if r <2800 else "AGC")
Buggy code:
R=input()
if R<1200:
  print("ABC")
elif R<2800:
  print("ARC")
else:
  print("AGC")

Fixed code:
R = int(input())

if R < 1200:
    print("ABC")
elif 2800 <= R :
    print("AGC")
else:
    print("ARC")
Buggy code:
r = input()
if r<1200:
  print("ABC")
elif r<2800:
  print("ARC")
else:
  print("AGC")

Fixed code:
r = int(input())
if r<1200:
  print("ABC")
elif r<2800:
  print("ARC")
else:
  print("AGC")
Buggy code:
r=int(input())
if r<1200:
    print("ABC")
elif 1200<r<2800:
    print("ARC")
else:
    print("AGC")

Fixed code:
r = int(input())

if r < 1200:
    print('ABC')
elif 1200 <= r and r < 2800:
    print('ARC')
else:
    print('AGC')
Buggy code:
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800
    print('ARC')
else:
    print('AGC')

Fixed code:
R=int(input())

if(R < 1200):
    print("ABC")
elif (1200 <= R < 2800):
    print("ARC")
else:
    print("AGC")
Buggy code:
r = int(input())
if r < 1200:
    print("ABC")
if 1200 <= r < 2800:
    print("ARC")
else:
    print("AGC")

Fixed code:
r = int(input())

print('ABC' if r<1200 else 'ARC' if r<2800 else 'AGC')
Buggy code:
def rate(n):
    if n < 1200:
        print('ABC')
    elif 1200 <= n <2800:
        print('ARC')
    else:
        print('AGC')

rate(input())

Fixed code:
def rate(n):
    if n < 1200:
        print('ABC')
    elif 1200 <= n <2800:
        print('ARC')
    else:
        print('AGC')

rate(int(input()))
Buggy code:
n=eval(input())
if n<1200:
	print("ABC")
elif n>=1200 and n<2800:
	print("ARC")
else:
    peint("AGC")

Fixed code:
n=eval(input())
if n<1200:
	print("ABC")
elif n>=1200 and n<2800:
	print("ARC")
else:
    print("AGC")
Buggy code:
x=input()
if (x< 1200):
  	print("ABC")
elif (x<2800):
  	print("ARC")
else:
  	print("AGC")

Fixed code:
x=int(input())
if (x< 1200):
  print("ABC")
elif (x<2800):
  print("ARC")
else:
  print("AGC")
Buggy code:
N = int(input())

if N < 1200:
    print("ABC")
if N >= 1200 and N < 2800:
    print("ARC")
else:
    print("AGC")

Fixed code:
N = int(input())

if N < 1200:
    print("ABC")
if N >= 1200 and N < 2800:
    print("ARC")
if N >= 2800:
    print("AGC")
Buggy code:
my_rate = input()
if my_rate < 1200:
        print("ABC")
elif my_rate >=1200 and my_rate < 2800:
        print("ARC")
else:
        print("AGC")


Fixed code:
my_rate = int(input())
if my_rate < 1200:
        print("ABC")
elif my_rate >=1200 and my_rate < 2800:
        print("ARC")
else:
        print("AGC")
Buggy code:
R = int(input())

if R < 1200:
  r = 'ABC'
elif R < 2800:
  r = 'ARC':
else:
  r ='AGC'

print(r)

Fixed code:
R=int(input())

if R <1200:
    print("ABC")
elif R <2800:
    print("ARC")
else:
    print("AGC")
Buggy code:
r = int (input ())
if r > 2800:
  print ('AGC')
elif r > 1200:
  print ('ARC')
else:
  print ('ABC')

Fixed code:
r = int (input ())
if r >= 2800:
  print ('AGC')
elif r >= 1200:
  print ('ARC')
else:
  print ('ABC')
Buggy code:
n = input()
if n < 1200:
    print ("ABC")
elif n < 2800:
    print ("ARC")
else:
    print ("AGC")

Fixed code:
n=int(input())
if n<1200:
    print('ABC')
elif n<2800:
    print('ARC')
else:
    print('AGC')
Buggy code:
n=int(input())
if n<1200:
  print('ABC')
elif n<2800&&n>=1200:
  print('ARC')
else:
  print('AGC')
  

Fixed code:
n=int(input())
if n<1200:
  print('ABC')
elif n>=2800:
  print('AGC')
else:
  print('ARC')
Buggy code:
R = int(input())

if R < 1200:
    print('ABC')
elif 2800:
    print('ARC')
else:
    print('AGC')


Fixed code:
R = int(input())
if R < 1200:
    print('ABC')
elif 1200 <= R < 2800:
    print('ARC')
elif 2800 <= R:
    print('AGC')
Buggy code:
r = input()
if r < 1200:
  print('ABC')
elif r >= 2800:
  print("AGC")
else:
  print('ARC')

Fixed code:
r = int(input())
if r < 1200:
  print('ABC')
elif r >= 2800:
  print("AGC")
else:
  print('ARC')
Buggy code:
R = int(input())
if R > 1200:
    print("ABC")
elif 1200 <= R < 2800:
    print("ARC")
else:
    print("AGC")

Fixed code:
R = int(input())
if R < 1200:
  print('ABC')
elif R < 2800:
  print('ARC')
else:
  print('AGC')
Buggy code:
R = int(input())

if R >= 2800:
    print('AGC')
elif R < 1200:
    print('ABC')
else:a
    print('ARC') 

Fixed code:
R = int(input())

if R >= 2800:
    print('AGC')
elif R < 1200:
    print('ABC')
else:
    print('ARC')
Buggy code:
a = int(input())
if a < 1200 :
    prunt('ABC')
elif a >= 1200 and a < 2800 :
    print('ARC')
else :
    print('AGC')

Fixed code:
a = int(input())
if a < 1200 :
    print('ABC')
elif a >= 1200 and a < 2800 :
    print('ARC')
else :
    print('AGC')
Buggy code:
R = int(input())
if R < 1200:
    print("ABC")
elif 1200 <= R < 2800:
    print("ARC")
else print("AGC")

Fixed code:
R = int(input())
if R<1200:
    print("ABC")
elif 1200<=R and R<2800:
    print("ARC")
else:
    print("AGC")
Buggy code:
R = input()
if R < 1200:
    print("ABC")
elif 1200 <= R < 2800:
    print("ARC")
else print("AGC")

Fixed code:
R = int(input())
if R < 1200:
    print("ABC")
elif 1200 <= R < 2800:
    print("ARC")
else :
    print("AGC")
Buggy code:
r=int(input())
if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  orint("AGC")

Fixed code:
r = int(input())
if r<1200:
  print('ABC')
elif 1200<=r<2800:
  print('ARC')
else:
  print('AGC')
Buggy code:
n = int(input())
if n < 1200:
  print('ABC')
elif n < 2800:
  print('ARC')
else:
  print('ARC')

Fixed code:
n = int(input())
if n<1200:
  print('ABC')
elif n < 2800:
  print('ARC')
else:
  print('AGC')
Buggy code:
n = int(input())
ans = ""
if n < 1200:
	ans = "ABC"
else if n < 2800:
	ans = "ARC"
else:
	ans = "AGC"

print(ans)


Fixed code:
n = int(input())
ans = ""
if n < 1200:
	ans = "ABC"
elif n < 2800:
	ans = "ARC"
else:
	ans = "AGC"

print(ans)
Buggy code:
a=input()
if a<=1199:
  print("ABC")
elif a<=2799:
  print("ARC")
else:
  print("AGC")

Fixed code:
a=input()
if int(a)<=1199:
  print("ABC")
elif int(a)<=2799:
  print("ARC")
else:
  print("AGC")
Buggy code:
r = int(input())
if r >= 2800:
  print('AGC')
if r >= 1200:
  print('ARC')
if r < 1200:
  print('ABC')

Fixed code:
r = int(input())
if r >= 2800:
  print('AGC')
  exit()
if r >= 1200:
  print('ARC')
  exit()
if r < 1200:
  print('ABC')
Buggy code:
n = int(input())
if n<1200: print("ABC")
elif: n<2800: print("ARC")
else: print("AGC")

Fixed code:
n = int(input())
if n<1200: print("ABC")
elif n<2800: print("ARC")
else: print("AGC")
Buggy code:
R = int(input())

print('ABC' if R <1200 else 'ARC' if N < 2800 else 'AGC')

Fixed code:
R = int(input())

print('ABC' if R <1200 else 'ARC' if R < 2800 else 'AGC')
Buggy code:
R = int(input())

if R < 1200:
  pritn("ABC")
  
elif R < 2800:
  print("ARC")
  
else:
  print("AGC")
  
  

Fixed code:
R = int(input())

if R < 1200:
  print("ABC")
  
elif R < 2800:
  print("ARC")
  
else:
  print("AGC")
Buggy code:
R = int(input())

if R >= 2800:
    peint("AGC")
elif R >= 1200:
    print("ARC")
else:
    print("ABC")

Fixed code:
R = int(input())

if R >= 2800:
    print('AGC')
elif R >= 1200:
    print('ARC')
else:
    print('ABC')
Buggy code:
n=int(input())
if n < 1200:
    print("ABC")
    elif n<2800:
    print("ARC")
   else:print("AGC")

Fixed code:
n=int(input())
if n<1200:
    print("ABC")
elif n<2800:
    print("ARC")
else:
    print("AGC")
Buggy code:
R = int(input())
if R < 1200:
    print('ABC')
if 1200 <= R < 2800:
    print('ARC')
else:
    print('AGC')


Fixed code:
R = int(input())
if R < 1200 :
    print("ABC")
elif R < 2800 :
    print("ARC")
else :
    print("AGC")
Buggy code:
n = int(input())
if n < 1199:
  print("ABC")
elif 1200 <= n < 2800:
  print("ARC")
else:
  print("AGC")


Fixed code:
n = int(input())
if n < 1200:
  print("ABC")
elif 1200 <= n < 2800:
  print("ARC")
else:
  print("AGC")
Buggy code:
r = int(input())
if r >= 2800 :
  print('AGC')
elif r >= 1200 :
  print('ARC'):
else:
  print('ABC')
  

Fixed code:
r = int(input())
if r >= 2800 :
  print('AGC')
elif r >= 1200:
  print('ARC')
else:
  print('ABC')
Buggy code:
R=int(input())
if 1200>R:
  print('ABC')
else if 2800>R:
  print('ARC')
else:
  print('AGC')

Fixed code:
R=int(input())

if 1200>R:
  print('ABC')
elif 2800>R:
  print('ARC')
else:
  print('AGC')
Buggy code:
R =input()
if R<1200:
  print('ABC')
elif R<2800:
  print('ARC')
else:
  print('AGC')

Fixed code:
R =int(input())
if R<1200:
  print('ABC')
elif R<2800:
  print('ARC')
else:
  print('AGC')
Buggy code:
r = int(input())

if r<1200:
  print('ABC')
elif r<2800:
  print('AGC')
else:
  print('ARC')

Fixed code:
r = int(input())
if r <1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")