qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def S(): return input().rstrip()

def main():
    N = I(); A = LI(); judge=True
    for i in A:
        if A%2==0:
            if A%3!=0 or A%5!=0:
                judge=False
    if judge:
        print('APPROVED')
    else:
        print('DENIED')
if __name__ == '__main__':
    main()

Fixed code:
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def S(): return input().rstrip()

def main():
    N = I(); A = LI(); judge=True
    for i in A:
        if i%2==0:
            if i%3!=0 and i%5!=0:
                judge=False
    if judge:
        print('APPROVED')
    else:
        print('DENIED')
if __name__ == '__main__':
    main()
Buggy code:
N = int(input())
l = list(map(int, input().split())
         
L = [i for i in l if i % 2 == 0]

K = [i for i in L if i % 3 != 0]

J = [i for i in K if i % 5 != 0]
         
if len(J) == 0:
         print("APPROVED")
else:
         print("DENIED")

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

L = [i for i in l if i % 2 == 0]
K = [i for i in L if i % 3 != 0]
J = [i for i in K if i % 5 != 0]

if len(J) == 0:
		print("APPROVED")
else:
        print("DENIED")
Buggy code:
import sys

n = int(input())
a = list(map(int, input().split()))
for i in a:
  if a % 2 == 0 and (a % 3 != 0 and a % 5 != 0):
    print("DENIED")
    sys.exit()
print("APPROVED")    

Fixed code:
import sys

n = int(input())
a = list(map(int, input().split()))
for i in a:
  if i % 2 == 0 and (i % 3 != 0 and i % 5 != 0):
    print("DENIED")
    sys.exit()
print("APPROVED")
Buggy code:
n = int(input())
a = [int(x) for x in input().split()]
res = "APPROVED"
for i in range(n):
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      res = "DENIED"
print(res)

Fixed code:
n = int(input())
a = [int(x) for x in input().split()]
res = "APPROVED"
for i in range(n):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 and a[i] % 5 != 0:
      res = "DENIED"
print(res)
Buggy code:
N=int(input())
S=[int(s) for s in input().split()]
for i in range(N):
    if S[i]%2==0 and S[i]%5!=0 and S[i]%3!=0:
        print("DENIED")
    elif i==N-1:
        print("APPROVED")

Fixed code:
N=int(input())
S=[int(s) for s in input().split()]
for i in range(N):
    if S[i]%2==0 and S[i]%5!=0 and S[i]%3!=0:
        print("DENIED")
        break
    elif i==N-1:
        print("APPROVED")
Buggy code:
import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 10**7+9
inf = 10**20

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

n = I()
a = LI()

for i in a:
    if i%2==0:
        if i%3!=0 and i%5!=0:
            print("DENID")
            exit()
print("APPROVED")

Fixed code:
import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 10**7+9
inf = 10**20

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

n = I()
a = LI()

for i in a:
    if i%2==0:
        if i%3!=0 and i%5!=0:
            print("DENIED")
            exit()
print("APPROVED")
Buggy code:
N=int(input())
A=list(map(int,input().split()))
p=True
for a in A:
  if a%2==0:
    if not a%3==0 or a%5==0:
      p=False
      break
print("APPROVED" if p else "DENIED")

Fixed code:
N=int(input())
A=list(map(int,input().split()))
p=True
for a in A:
  if a%2==0:
    if not (a%3==0 or a%5==0):
      p=False
      break
print("APPROVED" if p else "DENIED")
Buggy code:
N = input()
A = map(int, input().split())

for x in A:
    if x%2==0&(x%3!=0 and x%5!=0):
        print('DENIED')
        exit()
print('APPROVED')

  



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

for x in A:
    if x%2==0:
      if x%3!=0 and x%5!=0:
        print('DENIED')
        exit()
print('APPROVED')
Buggy code:
read = lambda: map(int, input().split())
n = int(input())
a = list(read())
print('APPROVED' if sum(i%3 and i%5 for i in a) ==0 else 'DENIED')

Fixed code:
read = lambda: map(int, input().split())
n = int(input())
a = list(read())
print('APPROVED' if sum(i%3 and i%5 for i in a if i%2==0) ==0 else 'DENIED')
Buggy code:
N = int(input())
l = list(map(int,input().split()))
for i in range(N):
  if l[i]%3 != 0 and l[i]%5 != 0:
    print('DINIED')
    exit()
print('APPROVED')

Fixed code:
N = int(input())
l = list(map(int,input().split()))
for i in range(N):
  if l[i]%2 == 0 and l[i]%3 != 0 and l[i]%5 != 0:
    print('DENIED')
    exit()
print('APPROVED')
Buggy code:
N = int(input())
A = list(map(int, input().split()))

f = True
for a in A:
  if (a&1)==0 and ((a%3==0) or (a%5==0)):
    pass
  else:
    f = False
if f:
  print("APPROVED")
else:
  print("DENIED")
    

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

f = True
for a in A:
  if (a&1)==0:
    if ((a%3==0) or (a%5==0)):
      pass
    else:
      f = False

if f:
  print("APPROVED")
else:
  print("DENIED")
Buggy code:
N = int(input())
A = list(int, input().split())
for i in A:
    if not(i % 3 == 0 or i % 5 == 0):
        print("DENIED")
        break
else:
    print("APPROVED")

Fixed code:
N = int(input())
A = list(map(int, input().split()))
for i in A:
    if i % 2 == 0:
        if not(i % 3 == 0 or i % 5 == 0):
            print("DENIED")
            break
else:
    print("APPROVED")
Buggy code:
import sys

def result():


    input_first = input().split()
    input_second = input().split()

    N= input_first
    paper = [int(i) for i in input_second]


    for num in paper:
        if num%2 ==0 and num%3==0 or num %5 == 0:
            print('APPROVED')
            return 

    print('DENIED')



result()



Fixed code:
import sys

def result():


    input_first = input().split()
    input_second = input().split()

    N= input_first
    paper = [int(i) for i in input_second]


    for num in paper:
        if num%2 ==0 and num%3!=0 and num %5 != 0:
            print('DENIED')
            return 

    print('APPROVED')
    return 


result()
Buggy code:
n = int(input())

s = list(map(int,input().split(" ")))
 
count = 0
for x in range(n):
  if s[x]%2 == 0 and (s[x]%5 != 0 or s[x]%3 != 0):
    count += 1
    
if count == 0:
  print("APPROVED")
else:
  print("DENIED")

Fixed code:
n = int(input())
 
s = list(map(int,input().split(" ")))
 
count = 0
for x in range(n):
  if s[x]%2 == 0 and (s[x]%5 != 0 and s[x]%3 != 0):
    count += 1
    
if count == 0:
  print("APPROVED")
else:
  print("DENIED")
Buggy code:
N = int(input())
A = list(int(x) for x in input().split())
found = True

for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 != 0 and A[i] % 5 != 0:
            found = False
            break

if found:
    print('APPRPVED')
else:
    print('DENIED')


Fixed code:
N = int(input())
A = list(int(x) for x in input().split())
found = True

for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 != 0 and A[i] % 5 != 0:
            found = False
            break

if found:
    print('APPROVED')
else:
    print('DENIED')
Buggy code:
n = int(input())
a = list(map(int,input().split()))
ok = True
for x in a:
    if x %2 == 0:
        if x %3!=0 and x %5 != 0:
            ok = False
            break
if ok:
    print("APPROVED")
else:
    print("DENINED")
    

Fixed code:
n = int(input())
a = list(map(int,input().split()))
ok = True
for x in a:
    if x %2 == 0:
        if x %3!=0 and x %5 != 0:
            ok = False
            break
if ok:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
n = int(input())
A = list(map(int, input().split()))[
ans = 1
for a in A:
  if a%2==0:
    if a%3!=0 and a%5!=0:
      ans = 0
print('APPROVED' if ans else 'DENIED')

Fixed code:
n = int(input())
A = list(map(int, input().split()))
ans = 1
for a in A:
  if a%2==0:
    if a%3!=0 and a%5!=0:
      ans = 0
print('APPROVED' if ans else 'DENIED')
Buggy code:
n = int(input())
a = list(map(int, input().split()))

for i in range(n):
    if a[i] % 2 == 0:
        if (a[i] % 3 == 0) | (a[i] % 5 == 0):
            print('DENIED')
            break
else:
    print('APPROVED')

Fixed code:
n = int(input())
a = list(map(int, input().split()))

for i in range(n):
    if a[i] % 2 == 0:
        if not ((a[i] % 3 == 0) | (a[i] % 5 == 0)):
            print('DENIED')
            break
else:
    print('APPROVED')
Buggy code:
n = int(input())

L = list(map(int, input().split()))
S=set()
for i in range(n):
	if L[i]%2==0:
		S.add(L[i])
p=0
for s in S:
	if s%3!=0 or s%5!=0:
		print('DENIED')
		p+=1
		break

if p==0:
	print('APPROVED')

Fixed code:
n = int(input())

L = list(map(int, input().split()))
S=set()
for i in range(n):
	if L[i]%2==0:
		S.add(L[i])
p=0
for s in S:
	if s%3!=0 and s%5!=0:
		print('DENIED')
		p+=1
		break

if p==0:
	print('APPROVED')
Buggy code:
import sys
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
  if A[i] % 2 != 0:
    print("DENIED")
    sys.exit()
  elif A[i] % 3 != 0 and A[i] % 5 != 0:
    print("DENIED")
    sys.exit()
  else:
    pass
print("APPROVED")

Fixed code:
import sys
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
  if A[i] % 2 != 0:
    pass
  elif A[i] % 3 != 0 and A[i] % 5 != 0:
    print("DENIED")
    sys.exit()
  else:
    pass
print("APPROVED")
Buggy code:
from sys import stdin,stdout
def f(A):
	for i in A:
		if i%2==0:
			if i%3!=0 and i%5!=0:
				return 'DENIED'
	return 'APROVED'

def main():  	
	for x in stdin:

		A = list(map(int,input().split()))
		
		print(f(A))

if __name__ == "__main__":
    main()


Fixed code:
from sys import stdin,stdout
def f(A):
	for i in A:
		if i%2==0:
			if i%3!=0 and i%5!=0:
				return 'DENIED'
	return 'APPROVED'

def main():  	
	for x in stdin:

		A = list(map(int,input().split()))
		
		print(f(A))

if __name__ == "__main__":
    main()
Buggy code:
n=int(input())

a=list(map(int,input().split()))

t=1

for i in range(n):
    if a[i]%2==0 and a[i]%3==0 and a[i]%5==0:
        t=1
    elif a[i]%2==1:
        t=1
    else:
        t=0
        break 

if t==1:
    print("APPROVED")
else:
    print("DENIED")

Fixed code:
n=int(input())

a=list(map(int,input().split()))

t=1

for i in range(n):
    if a[i]%2==0 and a[i]%3==0:
        t=1
    elif a[i]%2==0 and a[i]%5==0:
        t=1
    elif a[i]%2==1:
        t=1
    else:
        t=0
        break 

if t==1:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:

num = input()
a = input().split()
flag = 0
for item in a:
    if item%2==0:
        if item%3==0 or item%5==0:
            pass
        else:
            flag=1

if flag==0:
    print("APPROVED")
else:
    print("DENIED")

Fixed code:

num = input()
a = input().split()
flag = 0
for item in a:
    item=int(item)
    if item%2==0:
        if item%3==0 or item%5==0:
            pass
        else:
            flag=1

if flag==0:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
import sys

As = [int(n) for n in input().split()]

for A in As:
    if A % 2 == 0:
        if not(A % 3 == 0 or A % 5 == 0):
            print('DENIED')
            sys.exit(0)

print('APPROVED')


Fixed code:
import sys
N = input()
As = [int(n) for n in input().split()]

for A in As:
    if A % 2 == 0:
        if not(A % 3 == 0 or A % 5 == 0):
            print('DENIED')
            sys.exit(0)

print('APPROVED')
Buggy code:
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
    
    for k in m:
        if k%2==0:
            l.append(k)
    
    for p in l:
        if p%3==0 or p%5==0:
            a.append(p)
        else:
            b.append(p)

    if len(a)==len(l):
        print("APPROVED")
    else:
        print("DENIDE")

Fixed code:
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
    
    for k in m:
        if k%2==0:
            l.append(k)
    
    for p in l:
        if p%3==0 or p%5==0:
            a.append(p)
        else:
            b.append(p)
 
    if len(a)==len(l):
        print("APPROVED")
    else:
        print("DENIED")
    break
Buggy code:
n = int(input())
a = (int(num) for num in input().split())
ans = "APPROVED"
for i in range(n):
  if a[i] % 2 == 0 and a[i] % 3 != 0 and a[i] % 5 != 0:
    ans = "DENIED"
print(ans)

Fixed code:
n = int(input())
a = [int(num) for num in input().split()]
ans = "APPROVED"
for i in range(n):
  if a[i] % 2 == 0 and a[i] % 3 != 0 and a[i] % 5 != 0:
    ans = "DENIED"
print(ans)
Buggy code:
n = int(input())
a_list = list(map(int, input().split()))

a_list_even = [i for i in a_list if i % 2 == 0]

for a in a_list_even:
    if a % 3 == 0 or a % 5 == 0:
        continue
    else:
        print("DENIDE")
        exit()

print("APPROVED")

Fixed code:
n = int(input())
a_list = list(map(int, input().split()))

a_list_even = [i for i in a_list if i % 2 == 0]
for a in a_list_even:
    if a % 3 == 0 or a % 5 == 0:
        continue
    else:
        print("DENIED")
        exit()

print("APPROVED")
Buggy code:
N = int(input())
s = map(int,input().split())

a = 0
for i in range(N):
    if s[i]/2 == s[i]//2:
        if s[i]/3 == s[i]//3 or s[i]/5 == s[i]//5:
          a = a + 1
    else:
        a = a + 1

if a == N:
    print("APPROVED")
else:
    print("DENIED")

Fixed code:
N = int(input())
s = [int(x) for x in input().split()]
 
a = 0
for i in range(N):
    if s[i]/2 == s[i]//2:
        if s[i]/3 == s[i]//3 or s[i]/5 == s[i]//5:
          a = a + 1
    else:
        a = a + 1
 
if a == N:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
n = int(input())
a = list(map(int, input().split()))
ans = 'APPROVED'

aa = filter(lambda num: True if num % 2 == 0 else False, a)
for num in aa:
    if (num // 3 != 0) and (num // 5 != 0):
        ans = 'DENIED'

print(ans)


Fixed code:
n = int(input())
a = list(map(int, input().split()))
ans = 'APPROVED'

aa = filter(lambda num: True if num % 2 == 0 else False, a)
for num in aa:
    if (num % 3 != 0) and (num % 5 != 0):
        ans = 'DENIED'

print(ans)
Buggy code:
N = int(input().split())
A = list(map(int, input(),split()))

for a in A:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            print('DENIED')
            exit()

print('APPROVED')


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

for a in A:
  if a % 2 == 0:
    if a % 3 != 0 and a % 5 != 0:
      print('DENIED')
      exit()
print('APPROVED')
Buggy code:
N = int(input())
X = map(int,input().split())
def check():
    for i in range(N):
        if(i%2 == 0):
            if(i%3 == 0 & i%5 == 0):
                continue
            else:
                print("DENIED")
                return 0

        else:
            continue
    print("APPROVED")
check()


Fixed code:
N = int(input())
X = map(int,input().split())
def check():
    for i in X:
        if(i%2 == 0):
            if(i%3 == 0 or i%5 == 0):
                continue
            else:
                print("DENIED")
                return 0

        else:
            continue
    print("APPROVED")
check()
Buggy code:
n = int(input())
a = list(map(int,input().split()))
cnt=0
for i in range(n):
    if a[i]%2==0:
        if a[i]%3==0:
            pass
        elif a[i]%5==0:
            pass
        else:
            cnt+=1
if cnt==0:
    print("APPROVED")
else:
    print(cnt)
    print("DENIED")

Fixed code:
n = int(input())
a = list(map(int,input().split()))
cnt=0
for i in range(n):
    if a[i]%2==0:
        if a[i]%3==0:
            pass
        elif a[i]%5==0:
            pass
        else:
            cnt+=1
if cnt==0:
    print("APPROVED")
else:
    #print(cnt)
    print("DENIED")
Buggy code:
# 155b

def atc_155b(input_value: str) -> str:
    N = int(input_value[0])
    Ai = [int(ai) for ai in input_value[1].split(" ")]
    for i in range(0, N):
        if Ai[i] % 2 == 0 and Ai[i] % 3 != 0 and Ai[i] % 5 != 0:
            return "DENIED"
    return "APPROVED"

N = input()
Ai = input()
print(atc_155b[N, Ai])


Fixed code:
# 155b

def atc_155b(input_value: str) -> str:
    N = int(input_value[0])
    Ai = [int(ai) for ai in input_value[1].split(" ")]
    for i in range(0, N):
        if Ai[i] % 2 == 0 and Ai[i] % 3 != 0 and Ai[i] % 5 != 0:
            return "DENIED"
    return "APPROVED"

N = input()
Ai = input()
print(atc_155b([N, Ai]))
Buggy code:
N = int(input())
ALis = list(map(int,input().split()))
Flag = True

for i in range(N):
    if ALis[i] % 2 == 0:
        if ALis[i] % 3 != 0 and ALis[i] % 5 != 0:
           Flag = False

if Flag:
    print("APPROVE") 
else:
    print("DENIED")
    

Fixed code:
N = int(input())
ALis = list(map(int,input().split()))
Flag = True

for i in range(N):
    if ALis[i] % 2 == 0:
        if ALis[i] % 3 != 0 and ALis[i] % 5 != 0:
           Flag = False

if Flag:
    print("APPROVED") 
else:
    print("DENIED")
Buggy code:
N = int(input())
data = list(input().split())
sw1 = 0
sw2 = 0
for i in range(0,len(data)):
    if int(data[i]) % 2 == 0:
        sw1 += 1
        if int(data[i]) % 3 == 0 or int(data[i]) % 5 == 0:
            sw2 += 1

print(sw1,sw2)
if sw1 > 0 and sw1 == sw2:
    print("APPROVED")
else:
    print("DENIED")

Fixed code:
N = int(input())
data = list(map(int,input().split()))
sw1 = 0
sw2 = 0
for i in range(0,len(data)):
    if data[i] % 2 == 0:
        sw1 += 1
        if data[i] % 3 == 0 or data[i] % 5 == 0:
            sw2 += 1

if sw1 >= 0 and sw1 == sw2:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
N = int(input())
A = list(map(int,input().split()))
flag = 'APPROVED'
for a in A:
    print(a)
    if a % 2 == 0:
        if a % 3 != 0:
            if a % 5 != 0:
                flag = 'DENIED'
            break
print(flag)

Fixed code:
N = int(input())
A = list(map(int,input().split()))
flag = 'APPROVED'
for a in A:
    if a % 2 == 0:
        if a % 3 != 0:
            if a % 5 != 0:
                flag = 'DENIED'
print(flag)
Buggy code:
N = int(input())
Af = list(map(int,input().split()))
A = list()
for i in range(N):
  if Af[i] % 2 == 0:
      A.append(Af[1])
      continue
  else:
      continue
for i in range(len(A)):
  if A[i] % 3 != 0 and A[i] % 5 != 0:
      print('DENIED')
      import sys
      sys.exit()
  if A[i] % 3 == 0 or A[i] % 5 == 0:
      continue 
print('APPROVED')

Fixed code:
N = int(input())
Af = list(map(int,input().split()))
A = list()
for i in range(N):
  if Af[i] % 2 == 0:
      A.append(Af[i])
      continue
  else:
      continue
for i in range(len(A)):
  if A[i] % 3 != 0 and A[i] % 5 != 0:
      print('DENIED')
      import sys
      sys.exit()
  if A[i] % 3 == 0 or A[i] % 5 == 0:
      continue 
print('APPROVED')
Buggy code:
N = int(input())
A = list(map(int, input().split()))
fl = True
for i in A:
    if i&1:
        continue
    else:
        if i%3!=0 or i%5!=0:
            fl = False
            break

print('APPROVED') if fl else print('DENIED')

Fixed code:
N = int(input())
A = list(map(int, input().split()))
fl = True
for i in A:
    if i&1:
        continue
    else:
        if i%3!=0 and i%5!=0:
            fl = False
            break

print('APPROVED') if fl else print('DENIED')
Buggy code:
N = int(input())
A = [int(i) for i in input().split()]

t = 0
for i in range(N):
    if A[i]%2 == 0:
        if A[i]%3 != 0 and A[i]%5 != 0:
            t += 1
    break
print('APPRPVED' if t == 0 else 'DENIED')

Fixed code:
N = int(input())
A = [int(i) for i in input().split()]
t = 0
for i in range(N):
    a = A[i]
    if a%2 == 0:
        if a%3 != 0 and a%5 != 0:
            t += 1
            break

if t == 0:
    print('APPROVED')
else:
    print('DENIED')
Buggy code:
num = int(input())
lst = list(map(int,input().split()))
count = 0
counta == 0
for i in range(num):
  if lst[i] % 2 == 0:
    count += 1
    if lst[i] % 3 == 0 or lst[i] % 5 == 0:
      counta += 1
if count == counta:
  print("APPROVED")
else:
  print("DENIED")

Fixed code:
num = int(input())
lst = list(map(int,input().split()))
count = 0
counta = 0
for i in range(num):
  if lst[i] % 2 == 0:
    count += 1
    if lst[i] % 3 == 0 or lst[i] % 5 == 0:
      counta += 1
if count == counta:
  print("APPROVED")
else:
  print("DENIED")
Buggy code:
n=int(input())
a=list(map(int,input().split()))
ans="APPROVED"
for i in range (n):
  if a[i]%2==0:
    if a[i]%3!=0 and a[i]%5!=0:
      ans="DENIED"
    else:
      ans="APRROVED"
    
print(ans)

Fixed code:
n=int(input())
a=list(map(int,input().split()))
ans="APPROVED"
for i in range (n):
  if a[i]%2==0:
    if a[i]%3!=0 and a[i]%5!=0:
      ans="DENIED"
    
    
print(ans)
Buggy code:
N=int(input())
A=list(map(int,input().split()))
B=[0]*N
for i in range(N):
    if A[i]%2==1:
        B[0]=0
    else :
        if A[i]%5==0 or A[i]%3==0 :
            B[i]=0
        else :
            B[i]=1
print("APPROVED" if sum(B)==0 else "DENIED")

Fixed code:
N=int(input())
A=list(map(int,input().split()))
B=[0]*N
for i in range(N):
    if A[i]%2==1:
        B[i]=0
    else :
        if A[i]%5==0 or A[i]%3==0 :
            B[i]=0
        else :
            B[i]=1
print("APPROVED" if sum(B)==0 else "DENIED")
Buggy code:
x = input()
y = input()
list = y.split()
even_list = []

for i in list:
  i = int(i)
  if i % 2 == 0:
    even_list.append(i)
    
for y in even_list:
  if y % 3 == 0 or y % 5 == 0:
    result = "APROVED"
  else:
    result = "DENIED"
    break
    
print(result)


Fixed code:
x = input()
y = input()
list = y.split()
even_list = []
result = ''

for i in list:
  i = int(i)
  if i % 2 == 0:
    even_list.append(i)
  else:
    result = "APPROVED"
    
for y in even_list:
  if y % 3 == 0 or y % 5 == 0:
    result = "APPROVED"
  else:
    result = "DENIED"
    break
    
print(result)
Buggy code:
n = int(input())
a = (int(x) for x in input().split())
for num in a:
  if num%2 = 0:
    if num%3 != 0 and num%5 != 0:
    print('DENIED')
    exit()
print('APPROVED')

Fixed code:
n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
      print('DENIED')
      exit()
print('APPROVED')
Buggy code:
n = int(input())
l = map(int,input().split())

isDenyed = False

for x in l :
   if x % 2 == 0 :
       if (x % 3 == 0) or (x % 5 == 0) :
           continue
       else :
           isDenyed = True
           print('x = %d' % x)
           break

if isDenyed :
    print('DENIED')
else :
    print('APPROVED')


Fixed code:
n = int(input())
l = map(int,input().split())

isDenyed = False

for x in l :
   if x % 2 == 0 :
       if (x % 3 == 0) or (x % 5 == 0) :
           continue
       else :
           isDenyed = True
           break

if isDenyed :
    print('DENIED')
else :
    print('APPROVED')
Buggy code:
print("APPROVED" if all([n%3==0 or n%5==0 for n in map(int,input(int(input())).split()) if not n%2]) else "DENIED") 

Fixed code:
input();print("APPROVED" if all([n%3==0 or n%5==0 for n in map(int,input().split()) if not n%2]) else "DENIED")