qyliang/CodeNanoFix huggingface dataset:
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:
x = int(input())

if x < 1200:
  print("AGC")
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:
l = input()
if l<1200:
    print("ABC")
elif l<2800
    print("ARC")
else :
    print("AGC")

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

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

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

main()

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

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

Fixed code:
n=int(input());print("ABC"if n<1200 else"ARC"if n<2800 else"AGC")
Buggy code:
a=int(input())
if a<1200:
  print(ABC)
elif 1199<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:
n=int(input())
print('ABC') if n<1200 elif 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 < 1200:
    print("ABC")
elif 1999 < 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:
# coding: utf-8
R = int(input())
print(R)
if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Fixed code:
# coding: utf-8
R = int(input())
# print(R)
if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')
Buggy code:
def main():
    n = int(input())

    if n >> 2800:
        print('AGC')
    elif n >= 1200:
        print('ARC')
    else:
        print('ABC')

if __name__ == '__main__':
    main()

Fixed code:
def main():
    n = int(input())

    if n >= 2800:
        print('AGC')
    elif n >= 1200:
        print('ARC')
    else:
        print('ABC')

if __name__ == '__main__':
    main()
Buggy code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

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


Fixed code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

r = k()
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 >= 1200 and r < 2800:
  print('ARC')
else:
  print('AGC')
Buggy code:
r = int(input())

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

Fixed code:
r = int(input())
if r < 1200:
   print('ABC')
elif 1200 <= r and r < 2800:
    print('ARC')
else:
    print('AGC')
Buggy code:
# -*- coding: utf-8 -*-
R = int(input())
if R >=2800:
  print("AGC")
elif R >= 1200 and 2800 > R:
  print("ARC")
else:
  print("AGC")

Fixed code:
# -*- coding: utf-8 -*-
R = int(input())
if R >=2800:
  print("AGC")
elif R >= 1200 and 2800 > R:
  print("ARC")
else:
  print("ABC")
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:
    output="ABC"
elif R<=2800:
    output="ARC"
else:
    output="AGC"
print(output)

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 <2800:
    print('ARC')
else:
    print('AGC')

Fixed code:
R = int(input())

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

Fixed code:
a = int(input())

if (a<1200) :
   print("ABC")

elif (a<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 a <2800:
     print("ARC")
else:
    print("AGC")
Buggy code:
x = int(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:
r=int(input())
if r<1200:
  print('ABC')
if 1199<r<2800:
  print('ARC')
else:
  print('AGC')

Fixed code:
r=int(input())
if r<1200:
  print('ABC')
elif 1199<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:
    C = 'ABC'
elif R < 2800:
    C = 'ARC'
else:
    C = 'AGC'
print(C)
Buggy code:
v = int(input())

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

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

Fixed code:
num = int(input())
if (num < 1200):
  print("ABC")
elif (num < 2800):
  print("ARC")
else:
  print("AGC")
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')
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:
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 < 2800:
    print("ARC")

elif 2800 <= R:
    print("AGC")
Buggy code:
R = int(input())

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

Fixed code:
R = int(input())

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

Fixed code:
a=input()
if int(a)<1200:
    print("ABC")
elif int(a)<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:
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:
n=int(input())
if n<1200:
  print("ABC")
elif:
  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　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:
a=int(input())
if a > 2800:
	print('AGC')
elif a>1200:
	print('ARC')
else:
	print('ABC')

Fixed code:
a=int(input())
if a >= 2800:
	print('AGC')
elif a>=1200:
	print('ARC')
else:
	print('ABC')
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("ARC")
else:
  print("AGC")

Fixed code:
r=int(input())
if r<1200:
  print('ABC')
elif r>=2800:
  print('AGC')
else:
  print('ARC')
Buggy code:
r = 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 1200 <= a < 2800 :
  print('ARC')
else :
  print('AGC')
Buggy code:
r = int(input("R: "))

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>1200 and R<=2800:
    print('ARC')
else :
    print('AGC')

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')
if 1200 < r & r < 2800:
    print('ARC')
if 2800 < r:
    print('AGC')


Fixed code:
r = int(input())

if r < 1200:
    print('ABC')
if 1200 <= r & r < 2800:
    print('ARC')
if 2800 <= r:
    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 r <2800:
    print("ARC")
else:
    print("AGC")
Buggy code:
n = int(input())
if n < 1200:
    print('ABC')
elif 1200 < 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:
    r='ABC'
if R<2800:
    r='ARC'
else:
    r='AGC'
print(r)

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

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 1200 <= 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:
r = int(input())
if r < 1200:
  print("ABC")
else 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:
a = int(input())
if a < 1200:
  print("ABC")
else if a < 2800:
  print("ARC")
else:
  print("AGC")

Fixed code:
a = int(input())
if a < 1200:
 print("ABC")
elif a < 2800:
 print("ARC")
else:
 print("AGC")
Buggy code:
#-*-coding:utf-8-*-

def main():
    r = int(input())
    if r < 2000:
        print('ABC')
    elif r >= 1200 ans r < 2800:
        print('ARC')
    else:
        print('AGC')

if __name__ == '__main__':
    main()

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

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

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

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

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

Fixed code:
inputs = input()
R = int(inputs)

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

Fixed code:
a = int(input())
if a <1200:
  print("ABC")
elif a <2800:
  print("ARC")
else:
  print("AGC")
Buggy code:
R = int(input())
if R < 1200:
    ptint("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:
n=input()
print('ABC' if n < 1200 else 'ARC' if 1200 <= n < 2800 else 'AGC')

Fixed code:
n = int(input())

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

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

Fixed code:
a = int(input())

if a < 1200:
    print('ABC')
elif 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 r<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:
    ans = "ABC"
elif R < 2800:
    ans = "ARC"
else:
    ans = "AGC"
print(ans)
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:
    ans = "ABC"
elif r < 2800:
    ans = "ARC"
else:
    ans = "AGC"

print(ans)
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 r <= 1999:
    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<1200:
    print("ABC")
if R<2800 and R>1200:
    print("ARC")
if 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:
s = list(input())
flg = "WA"
if s[0]=="A":
  if "C" in s[2:len(s)-1]:
    s.remove("A")
    s.remove("C")
    s = *s
    if s.islower()==True:
      flg = "AC"
print(flg)

Fixed code:
s = list(input())
flg = "WA"
if s[0]=="A":
  if "C" in s[2:len(s)-1]:
    s.remove("A")
    s.remove("C")
    s = ''.join(s)
    if s.islower()==True:
      flg = "AC"
print(flg)
Buggy code:
S = input()
N = len(S)
x = 0
if S[0] == 'A':
    if S[1] == 'C' or S[-1] == 'C':
        print('WA')
    else:
        if S.count('C') == 1:
            S.replace('A', '')
            S.replace('C', '')
            for i in range(N -2):
                if 97 <= ord(S[i]) <= 122:
                    x += 1
            if x == N - 2:
                print('AC')
            else:
                print('WA')
        else:
            print('WA')
else:
    print('WA')

Fixed code:
S = input()
N = len(S)
x = 0
if S[0] == 'A':
    if S[1] == 'C' or S[-1] == 'C':
        print('WA')
    else:
        if S.count('C') == 1:
            S.replace('A', '')
            S.replace('C', '')
            N = len(S)
            for i in range(N):
                if 97 <= ord(S[i]) <= 122:
                    x += 1
            if x == N - 2:
                print('AC')
            else:
                print('WA')
        else:
            print('WA')
else:
    print('WA')
Buggy code:
s = input().rstrip()

if s[0] != 'A':
    print('WA')
    exit(0)

f = False
for i in range(len(s)):
    if s[i] == 'C':
        if i < 2 or i >= len(s) - 2:
            print('WA')
            exit(0)
        if f:
            print('WA')
            exit(0)
        f = True
    elif not str.islower(s[i]):
        print('WA')

if f:
    print('AC')
else:
    print("WA")


Fixed code:
s = input().rstrip()

if s[0] != 'A':
    print('WA')
    exit(0)

f = False
for i in range(1, len(s)):
    if s[i] == 'C':
        if i < 2 or i >= len(s) - 1:
            print('WA')
            exit(0)
        if f:
            print('WA')
            exit(0)
        f = True
    elif not str.islower(s[i]):
        print('WA')
        exit(0)

if f:
    print('AC')
else:
    print("WA")
Buggy code:
import sys
S = input()


if S[0] == "A":
    C = S[2:-2]
    count = 0
    for c in C:
        if c == "C":
            count = count + 1
        if count==2:
            print("WA")
            sys.exit()
    if count==0:
        print("WA")
        sys.exit()
    S = S[1:]

    for s in S:
        if (ord("z") >= ord(s) and ord("a") <= ord(s)):
            continue
        elif s=="C":
            continue
        else:
            print("WA")
            sys.exit()
    print("AC")


Fixed code:
import sys
S = input()


if S[0] == "A":
    C = S[2:-1]
    count = 0
    for c in C:
        if c == "C":
            count = count + 1
        if count==2:
            print("WA")
            sys.exit()
    if count==0:
        print("WA")
        sys.exit()
    S = S[1:]

    for s in S:
        if (ord("z") >= ord(s) and ord("a") <= ord(s)):
            continue
        elif s=="C":
            continue
        else:
            print("WA")
            sys.exit()
    print("AC")
    sys.exit()
print("WA")
Buggy code:
S = input()
cheack1 = False
cheack2 = False
cheack3 = False
count = 0

if S[0]=='A':
    cheack1=True
    S = S.replace("A", "a")

if S[1]=="C" or S[int(len(S))-1]=="C":
    cheack2==False
else:
    for i in range(2, int(len(S))-1):
        if S[i]=="C":
            count += 1

    if count==1:
        cheack2=True
        S = S.replace("C","c")

cheack3 = S.islower()

print(str(cheack1)+" "+str(cheack2)+" "+str(cheack3))
if cheack1 and cheack2 and cheack3:
    print("AC")
else:
    print("WA")

Fixed code:
S = input()
cheack1 = False
cheack2 = False
cheack3 = False
count = 0

if S[0]=='A':
    cheack1=True
    S = S.replace("A", "a")

if S[1]=="C" or S[int(len(S))-1]=="C":
    cheack2==False
else:
    for i in range(2, int(len(S))-1):
        if S[i]=="C":
            count += 1

    if count==1:
        cheack2=True
        S = S.replace("C","c")

cheack3 = S.islower()

#print(str(cheack1)+" "+str(cheack2)+" "+str(cheack3))
if cheack1 and cheack2 and cheack3:
    print("AC")
else:
    print("WA")
Buggy code:
S = input()

ac = True

if S[0] != "A":
    ac = False

cnt = 0
for s in S[2:-2]:
    if s == "C":
        cnt += 1
if cnt != 1:
    ac = False

for s in S[1:]:
    if s != "C" and s.isupper():
        ac = False

if ac:
    print("AC")
else:
    print("WA")

Fixed code:
S = input()

ac = True

if S[0] != "A":
    ac = False

cnt = 0
for s in S[2:-1]:
    if s == "C":
        cnt += 1
if cnt != 1:
    ac = False

for s in S[1:]:
    if s != "C" and s.isupper():
        ac = False

if ac:
    print("AC")
else:
    print("WA")
Buggy code:
S = input()
print(S[2:-1])
if S[0] == "A":
    if "C" in S[2:-1] and S[2:-1].find("C") == S[2:-1].rfind("C"):
        S = S.replace("A","a",1)
        S = S.replace("C","c",1)
        if S == S.lower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

Fixed code:
S = input()
if S[0] == "A":
    if "C" in S[2:-1] and S[2:-1].find("C") == S[2:-1].rfind("C"):
        S = S.replace("A","a",1)
        S = S.replace("C","c",1)
        if S == S.lower():
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
Buggy code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    l = len(S)

    def judge():
        if S[0] != "A":
            return False
        T = S[2:l - 1]

        cnt = 0
        for char in T:
            if char == "C":
                cnt += 1
        if cnt != 1:
            return False

        for char in S:
            if char == "C":
                continue
            elif char.isupper():
                return False
        return True

    if judge():
        print("AC")
    else:
        print("WA")


if __name__ == '__main__':
    main()


Fixed code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    l = len(S)

    def judge():
        if S[0] != "A":
            return False
        T = S[2:l - 1]

        cnt = 0
        for char in T:
            if char == "C":
                cnt += 1
        if cnt != 1:
            return False

        for char in S[1:]:
            if char == "C":
                continue
            elif char.isupper():
                return False
        return True

    if judge():
        print("AC")
    else:
        print("WA")


if __name__ == '__main__':
    main()
Buggy code:
import sys
s=input()
cnt=0
if s[0]!='A':
    print('WA')
elif s[1].isuper():
    print('WA')
elif s[-1].isuper():
    print('WA')
else:
    for i in range(2,len(s)-1):
        if s[i]=='C':
            cnt+=1
        else:
            if s[i].isupper():
                print('WA')
                sys.exit()
    if cnt==1:
        print('AC')
    else:
        print('WA')

Fixed code:
import sys
s=input()
cnt=0
if s[0]!='A':
    print('WA')
elif s[1].isupper():
    print('WA')
elif s[-1].isupper():
    print('WA')
else:
    for i in range(2,len(s)-1):
        if s[i]=='C':
            cnt+=1
        else:
            if s[i].isupper():
                print('WA')
                sys.exit()
    if cnt==1:
        print('AC')
    else:
        print('WA')