qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N=int(input())
A=list(map(int,input().split()))
l=[]
for i in range(N):
    if A[i]%2==0:
        l.append(A[i])
flag=True
for i in range(N):
    if l[i]%3==0 or l[i]%5==0:
        pass
    else:
        flag=False
if flag:
    print("APPROVED")
else:
    print("DENIED")

Fixed code:
N=int(input())
A=list(map(int,input().split()))
l=[]
for i in range(N):
    if A[i]%2==0:
        l.append(A[i])
flag=True
for i in range(len(l)):
    if l[i]%3==0 or l[i]%5==0:
        pass
    else:
        flag=False
if flag:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
import sys
n=int(input())
a=list(map(int,input().split()))
for i in a:
  if i%2==0:
    if i%3!=0 or i%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:
    if i%3!=0 and i%5!=0:
      print("DENIED")
      sys.exit()
      
print("APPROVED")
Buggy code:
a = int(input())
 
b=list(map(int, input().split())) 
x = 0
c = 0
    
for i in b:
  if (i % a == 0) and (i % 2 == 0):
    x += 1

for t in b:
  if (t%2==0):
    c += 1;

if x == c:
  print('APPROVED')
else :
  print('DENIED')



Fixed code:
a = int(input())
 
b=list(map(int, input().split())) 
x = 0
c = 0
    
for i in b:
  if ((i % 3 == 0) or (i % 5 == 0)) and (i % 2 == 0):
    x += 1

for t in b:
  if (t%2==0):
    c += 1;

if x == c:
  print('APPROVED')
else :
  print('DENIED')
Buggy code:
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')
else: print('APPROVED')

Fixed code:
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')
    break
else: print('APPROVED')
Buggy code:
lis = list(map(int,input().split()))
x = 0
for i in lis:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            x = 1
if x == 0:
    print("APPROVED")
else:
    print("DENIED")

Fixed code:
N = int(input())
lis = list(map(int,input().split()))
x = 0
for i in lis:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            x += 1
if x == 0:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
N = int(input())
A = list(map(int,input().split()))

A= [i for i in A if i%2==0]
if len( [j for j in A if not ((j%3!=0)or(j%5!=0))]) == 0:
    print("APPROVED")
else:
    print("DENIED")

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

A= [i for i in A if i%2==0]
if len( [j for j in A if not ((j%3==0)or(j%5==0))]) == 0:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:

n=int(input())
l=list(map(int,input().split()))
f=1
for i in range(n):
    if  not l[i]%2:
        if l[i]%3 or l[i]%5 :
            f=0
            break
if f:
    print("APPROVED")
else:
    print("DENIED")
            


Fixed code:

n=int(input())
l=list(map(int,input().split()))
f=1
for i in range(n):
    if  l[i]%2==0:
        if l[i]%3 and l[i]%5 :
            f=0
            break
if f:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    ans = "APROVED"
    for ai in A:
        if ai%2 == 0:
            if ai%3 > 0 and ai%5 > 0:
                ans = "DENIED"
                break
    print(ans)

    return

if __name__ == "__main__":
    main()

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

    ans = "APPROVED"
    for ai in A:
        if ai%2 == 0:
            if ai%3 > 0 and ai%5 > 0:
                ans = "DENIED"
                break
    print(ans)

    return

if __name__ == "__main__":
    main()
Buggy code:
N = int(input())
A = list(map(int,intput().split()))

for i in range(N):
    if A[i]%2 == 0 and (A[i]%3 != 0 and A[i]%5 != 0):
        print('DENIED')
        exit()

print('APPROVED')

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

for i in range(N):
    if A[i]%2 == 0 and (A[i]%3 != 0 and A[i]%5 != 0):
        print('DENIED')
        exit()

print('APPROVED')
Buggy code:
N=int(input())
A=list(map(int,input().split()))
B=[]
for i in range (N):
    if A[i]%2==0:
        B.append(A[i])

x=len(B)
hantei=0
for i in range(x):
    if B[i]%3==0:
        hantei=hantei+1
    elif B[i]%5==0:
        hantei=hantei+1
    else:
        pass

if hantei>=2:
    print('APPROVED')
else:
    print('DENIED')

print(hantei)


Fixed code:
N=int(input())
A=list(map(int,input().split()))
B=[]
for i in range (N):
    if A[i]%2==0:
        B.append(A[i])

x=len(B)
hantei=0
for i in range(x):
    if B[i]%3==0:
        hantei=hantei+1
    elif B[i]%5==0:
        hantei=hantei+1
    else:
        pass

if hantei>=x:
    print('APPROVED')
else:
    print('DENIED')
Buggy code:
N = int(input())
num_list = list(map(int, input().split()))
 
a=0
for i in num_list:
  if i%2==0 and (i%3!=0 and i%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())
a = list(map(int,input().split()))

for i in a:
    if i % 2 ==0:
      if i %3 ==0 or i %5 ==0:
        print("APPROVED")
      else:
        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 i %3 ==0 or i %5 ==0:
        continue
      else:
        print("DENIED")
        break
else:
  print("APPROVED")
Buggy code:
n=int(input())
a=list(map(int, input().split()))

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

Fixed code:
n=int(input())
a=list(map(int,input().split()))
ans="APPROVED"
for i in range(n):
    if a[i]%2==0 and a[i]%3!=0 and a[i]%5!=0 and ans=="APPROVED":
        ans="DENIED"
print(ans)
Buggy code:
n=int(input())
a = list(map(int,input().split()))
i = 0
while True:
    if a[i]%2==1 or a[i]%3==0 or a[i]%5==0:
        i+=1
    elif i==n:
        print('APPROVED')
        break
    else:
        print('DENIED')
        break

Fixed code:
n=int(input())
a = list(map(int,input().split()))
i = 0
while True:
    if i==n:
        print('APPROVED')
        break
    elif a[i]%2==0 and a[i]%3!=0 and a[i]%5!=0:
        print('DENIED')       
        break       
    else:
        i+=1
Buggy code:
N = int(input())
people = [int(i) for i in input().split()]

is_True = True
for p in people:
    if p % 2 == 0:
        if p % 3 != 0 or p % 5 != 0:
            is_True = False
            break

if is_True:
    print("APPROVED")
else:
    print("DENIED")


Fixed code:
N = int(input())
people = [int(i) for i in input().split()]

is_True = True
for p in people:
    if p % 2 == 0:
        if p % 3 != 0 and p % 5 != 0:
            is_True = False
            break

if is_True:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
N = int(input())
lis = list(map(int,input().split()))
result = "APPROVED"
for i in lis:
    if i %2 ==0:
        if i %3 !=0 or i%5 !=0:
            result = "DENIED"
            break
print(result)

Fixed code:
N = int(input())
lis = list(map(int,input().split()))
result = "APPROVED"
for i in lis:
    if i %2 ==0:
        if i %3 !=0 and i%5 !=0:
            result = "DENIED"
            break
print(result)
Buggy code:
n = input()
nums = list(map(int,input().split()))

for num in nums:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
      print('DENIED')
      break
print('APPROVED')

Fixed code:
n = input()
nums = list(map(int,input().split()))
 
for num in nums:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
      print('DENIED')
      exit()
print('APPROVED')
Buggy code:
N = int(input())
A = list(map(int, input().split()))
count = 0
check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
        else:
            print('DENIED')
            break
if count == check:
	print('APROVED')

Fixed code:
N = int(input())
A = list(map(int, input().split()))
count = 0
check = 0
for i in A:
    if i%2 == 0:
        count += 1
        if i%3 == 0 or i%5 == 0:
            check += 1
if count == check:
	print('APPROVED')
else:
	print('DENIED')
Buggy code:
input()
for a in map(int,input().split()):
  if a&1: continue
  if a%3 or a%5: continue
  print("DENIED")
  exit()
print("APPROVED")

Fixed code:
input()
for a in map(int,input().split()):
  if a&1: continue
  if a%3 and a%5:
    print("DENIED")
    exit()
print("APPROVED")
Buggy code:
list_ = [int(x) for x in input().split() if (int(x) % 2) == 0]
for f in list_:
    if (f % 3 == 0) or (f % 5 == 0):
        continue
    else:
        print("DENIED")
        break
else:
    print("APPROVED")

Fixed code:
n=int(input())
list_ = [int(x) for x in input().split() if (int(x) % 2) == 0]
for f in list_:
    if (f % 3 == 0) or (f % 5 == 0):
        continue
    else:
        print("DENIED")
        break
else:
    print("APPROVED")
Buggy code:
N = int(input())
aa = map(int, input().split())

f = False
for a in aa:
  if a % 2 == 0:
    if a % 3 != 0:
      print('DENIED')
      f = True
      break
    elif a % 5 != 0:
      print('DENIED')
      f = True
      break
if not f:
  print('APPROVED')


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

f = False
for a in aa:
  if a % 2 == 0:
    if (a % 3 != 0) and (a % 5 != 0):
      print('DENIED')
      f = True
      break
if not f:
  print('APPROVED')
Buggy code:
N = int(input())
A = list(map(int, input().split()))

flag = 0

for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or if A[i] % 5 == 0:
            pass
        else:
            flag = 1
            break
    if flag = 0:
        print("PASS")
    else:
        print("DENIED")

Fixed code:
N = int(input())
A = list(map(int, input().split()))
flag = 0
for i in range(N):
  if A[i] % 2 == 0:
    if A[i] % 3 == 0 or A[i] % 5 == 0:
      pass
    else:
      flag = 1
      break
if flag == 0:
  print("APPROVED")
else:
  print("DENIED")
Buggy code:
N = int(input())
FLG=1

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

for i in range(N):
  if n[i]/2 == 0:
    if n[i]/3 != 0:
      FLG=0
    if n[i]/5 != 0:
      FLG=0
   
if FLG == 0:
  ans = "DENIED"
else:
  ans = "APPROVED"

print(ans)

Fixed code:
N = int(input())
FLG=1

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

for i in range(N):
  if n[i]%2 == 0:
    # print(n[i]%2)
    if n[i]%3 != 0:
      if n[i]%5 != 0:
        FLG=0
   
if FLG == 0:
  ans = "DENIED"
else:
  ans = "APPROVED"

print(ans)
Buggy code:
n= int(input())
lista=[]
listanova=[]
for x in input().split():
	x= int(x)
	if x %2 ==0:
		lista.append(x)
for x in lista:
	if x %3==0 or x%5==0:
		listanova.append(x)

if len(lista)==len(listanova):
	print('APROVED')
else:
	print('DENIED')


Fixed code:
n= int(input())
lista=[]
listanova=[]
for x in input().split():
	x= int(x)
	if x %2 ==0:
		lista.append(x)
for x in lista:
	if x %3==0 or x%5==0:
		listanova.append(x)

if len(lista)==len(listanova):
	print('APPROVED')
else:
	print('DENIED')
Buggy code:
n = int(input())
a_list = list(map(int, input().split()))

ans = 'APPRONED'
for i in range(0, n) :
  if a_list[i]%2 == 0 :
    if (a_list[i]%3)*(a_list[i]%5) != 0 :
      ans = 'DENIED'
      break
print(ans)


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

ans = 'APPROVED'
for i in range(0, n) :
  if a_list[i]%2 == 0 :
    if (a_list[i]%3)*(a_list[i]%5) != 0 :
      ans = 'DENIED'
      break
print(ans)
Buggy code:
a=int(input())
b=list(map(int,input().split()))
c=0
for i in range(a):
  if b[i]%2==0:
    if b[i]%3==0 or b[i]%5==0:
      c=c+1
if c==a:
  print("APPROVED")
else:
  print("DENIED")

Fixed code:
a=int(input())
b=list(map(int,input().split()))
c=0
for i in range(a):
  if b[i]%2==0:
    if b[i]%3==0 or b[i]%5==0:
      c=c+1
  else:
    c=c+1
if c==a:
  print("APPROVED")
else:
  print("DENIED")
Buggy code:
import sys
# N=5
# A=[6, 7, 9, 10, 31]
N=map(int,input())
A=list(map(int, input().split()))

A_even=[]
for i in A:
    if  (i%2)==0:
        A_even.append(i)
for i in A_even:
    if (i%3)==0 and (i%5)==0:
        print("DENIED")
        sys.exit()
print("APPROVED")
        


Fixed code:
import sys
# N=5
# A=[6, 7, 9, 10, 31]
N=map(int,input())
A=list(map(int, input().split()))

A_even=[]
for i in A:
    if  (i%2)==0:
        A_even.append(i)
for i in A_even:
    if (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()]

result = True


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

if result == True:
    print("APPROVED")
else:
    print("DENIED")


Fixed code:
N = int(input())
A = [int(x) for x in input().split()]

result = True


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

if result == True:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
N = int(input())


def read(): return list(map(int, input().split()))


data = read()
flag = True
for i in data:
    if (i % 2 == 0):
        if (i % 3 != 0 and i % 5 != 0):
            flag = False
            break
if (flag == True):
    print('APPROVED')
else:
    print('DEFINED')


Fixed code:
N = int(input())


def read(): return list(map(int, input().split()))


data = read()
flag = True
for i in data:
    if (i % 2 == 0):
        if (i % 3 != 0 and i % 5 != 0):
            flag = False
            break
if (flag == True):
    print('APPROVED')
else:
    print('DENIED')
Buggy code:
N = int(input())
*A, = map(int, input().split())
B = []
C = 1

for i in A:
  if i % 2 == 0:
    B.append(i)

for l in B:
  if l % 3 == 1 or l % 5 == 0:
    C += C + 1
    
if C/len(B) == 1:
  print('APPROVED')
else:
  print('DENIED')

Fixed code:
N = int(input())
*A, = map(int, input().split())
B = []
C = 0
for i in A:
  if i % 2 == 0:
    B.append(i)
    if i % 5 == 0 or i % 3 == 0:
      C += 1
 
if C == len(B):
  print('APPROVED')
else:
  print('DENIED')
Buggy code:
N = input()
N = int(N)
A = list(map(int,input().split()))
B = [ i for i in A if i % 2 == 0 or ]
C = [ d for d in B if i % 3 == 0 or i % 5 == 0]
R = len(C)
if R == 0:
  print("APPROVED")
else:
  print("DENIED")

Fixed code:
N = input()
N = int(N)
A = list(map(int,input().split()))
B = [ i for i in A if i % 2 ==0]
C = [ d for d in B if  d % 3 == 0 or d % 5 == 0]
R = len(C)
Q = len(B)
if R == Q:
  print("APPROVED")
  
else:
  print("DENIED")
Buggy code:
N = int(input())
A = list(map(int,input().split()))
flag = 1
for i in A:
    if i%3!=0 or i%5!=0:
        flag = 0
        break
if flag==1:
    print("APPROVED")
else:
    print("DENIED")

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


Fixed 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 and a[i]%5!=0:
            print("DENIED")
            exit()
print("APPROVED")
Buggy code:
n = int(input())
lst = list(map(int,input().split()))

flg = True
for i in range(n):
    if lst[i]%2!=0:
        continue
    if lst[i]%3!=0 or lst[i]%5!=0:
        flg = False
        break
print('APPROVED' if flg else 'DENIED')

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

flg = True
for i in range(n):
    if lst[i]%2!=0:
        continue
    if lst[i]%3==0 or lst[i]%5==0:
        continue
    else:
        flg=False
        break
print('APPROVED' if flg else 'DENIED')
Buggy code:
n=int(input())
a=map(int,input().split())

num = 0
for i in a:
  if i % 2 == 0:
    if i % 3 != 0:
      num='DENIED'
      break
    elif i % 5 != 0:
      num='DENIED'
      break
    else:
      num='APPROVED'
  else:
    num='DENIED'
print(num)




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

for i in a:
  if i % 2 == 0 and (i % 3 != 0 and i % 5 != 0):
      print('DENIED')
      break
else:
    print('APPROVED')
Buggy code:
N = int(input())

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

boolian = False

for i in range(N):
    if an[i] % 2 == 0:
        if an[i] % 3 ==0 or an[i] % 5 ==0:
            boolian = True
        else:
            boolian = False
            break
if boolian == False:
    print('DNIED')
    
if boolian == True:
    print('APPROVED')

Fixed code:
N = int(input())

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

boolian = True

for i in range(N):
    if an[i] % 2 == 0:
        if an[i] % 3 ==0 or an[i] % 5 ==0:
            boolian = True
        else:
            boolian = False
            break
if boolian == False:
    print('DENIED')
    
if boolian == True:
    print('APPROVED')
Buggy code:
N = input()
A = map(int,(input().split()))

output = 'APPROVED'

for n in A:
    if (n % 2 == 0) and (n % 6 != 0) or (n % 10 != 0):
        output = 'DENIED'
        
print(output)

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

output = 'APPROVED'
for n in A:
    if (n % 2 == 0) and (n % 6 != 0) and (n % 10 != 0):
        output = 'DENIED'
        
print(output)
Buggy code:
# import itertools
# import math


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    even = list(filter(lambda x: x % 2 == 0, A))

    for ee in even:
        if (ee % 3) != 0 and (ee % 5) != 0:
            print('DENYIED')
            return

    print('APPROVED')


resolve()


Fixed code:
# import itertools
# import math


def resolve():
    N = int(input())
    A = list(map(int, input().split()))

    even = list(filter(lambda x: x % 2 == 0, A))

    for ee in even:
        if (ee % 3) != 0 and (ee % 5) != 0:
            print('DENIED')
            return

    print('APPROVED')


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

test = True
for i in a:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      continue
    else:
      test = False
      break
if test:
  print('APPROVAL')
else:
  print('DENIED')
      

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

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

flag = 1
for i in range(N):
    if(A[i] % 2 == 0):
        print(flag)
        if(A[i] % 3 != 0 and A[i] % 5 != 0):
            flag = 0

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

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

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

if count == 0:
    print('APPROVED')
else:
    print('DENIED')
Buggy code:
n=input()
s=list(map(int,input().split()))
for i in s:
  if i%2==0:
    if i%3>0 or i%5>0:
      n=0
print(["APPROVED","DENIED"][n==0])

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



Fixed code:
n=int(input())
a=[int(i) for i in input().split()]
count=0
for i in a:
    if i%2==0:
        if i%3!=0 and i%5!=0:
            count+=1
            break
if count==0:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
n = int(input())
a_list = list(map(int, input().split()))
flag = "ok"
for i in a_list:
  if i%2 == 0: 
    if i%3 != 0 or i%5 != 0:
      flag = "ng"
if flag == "ok":
  print("APPROVED") 
else:
  print("DENIED")


Fixed code:
n = int(input())
a_list = list(map(int, input().split()))
flag = "ok"
for i in a_list:
  #print(i)
  if i%2 == 0: 
    if i%3 != 0 and i%5 != 0:
      flag = "ng"
if flag == "ok":
  print("APPROVED") 
else:
  print("DENIED")
Buggy code:
n = int(input())
a = list(map(int,input().split()))

for i in range(n):
    if a[i]%5!=0 and a[i]%3!=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 a[i]%5!=0 and a[i]%3!=0:
            print('DENIED')
            break
else:
    print('APPROVED')
Buggy code:
N = int(input())

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

even = 0
bai = 0
for i in range(N):
    if A[i] % 2 == 0:
        even = even + 1
        print(even)
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            bai = bai + 1
    i = i + 1
    
if even == bai:
    print("APPROVED")
else:
    print("DENIED")
            
            

Fixed code:
N = int(input())

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

even = 0
bai = 0
for i in range(N):
    if A[i] % 2 == 0:
        even = even + 1
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            bai = bai + 1
    i = i + 1
    
if even == bai:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
N=int(input())
li = list(map(int,input().split()))

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      break
  continue
  print('APPROVED')

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

flag = 0

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      flag = 1
      break
    else:
      continue
      
if flag == 0:
  print('APPROVED')
Buggy code:
lst = list(map(int, input().split()))

for l in lst:
    if l % 2 == 0:
        if l % 3 == 0 or l % 5 == 0:
            continue
        else:
            print("DENIED")
            exit()

print("APPROVED")


Fixed code:

cnt  = int(input())
lst = list(map(int, input().split()))

for l in lst:
    if l % 2 == 0:
        if l % 3 == 0 or l % 5 == 0:
            continue
        else:
            print("DENIED")
            exit()

print("APPROVED")
Buggy code:
n=int(input())
a=list(map(int,input().split()))
f=0
for i in range(n):
    if a[i]%2==0 and (a[i]%3==0 or a[i]%5==0):
        f=1
    if a[i]%2==0:
        f=0
        break
    else:
        f=1
if f==1:
    print("APPROVED")
else:
    print("DENIED")

Fixed code:
n=int(input())
a=list(map(int,input().split()))
f=1
for i in range(n):
    if a[i]%2==0 and a[i]%3!=0 and a[i]%5!=0:
        f=0
        break
if f==1:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
import sys
n = int(input())
a = list(map(int,input().split()))
flag = 0
for i in range(n):
    if(a[i]%2 == 0):
        if(a[i]%3 == 0 or a[i]%5 == 0):
            print(end="")
        else:
            print("DENITED")
            sys.exit()
print("APPROVED")

Fixed code:
import sys
n = int(input())
a = list(map(int,input().split()))
flag = 0
for i in range(n):
    if(a[i]%2 == 0):
        if(a[i]%3 == 0 or a[i]%5 == 0):
            print(end="")
        else:
            print("DENIED")
            sys.exit()
print("APPROVED")
Buggy code:
N = int(input())
A = list(map(int, input().split()))
AA = [x % 3 == 0 or x % 5 == 0 for x in A if x % 2 == 0]
if any(AA):
  print("APPROVED")
else:
  print("DENIED")

Fixed code:
N = int(input())
A = list(map(int, input().split()))
AA = [x % 3 != 0 and x % 5 != 0 for x in A if x % 2 == 0]
if any(AA):
  print("DENIED")
else:
  print("APPROVED")
Buggy code:
N = int(input())
S = list(map(int,input().split()))
B= list()
X = list()
for i in S:
    if i % 2== 0:
        B.append(i)
for n in B:
    if n % 3 == 0 or n % 5 == 0:
        X.append(n)
if len(B) == len(X):
    print('APPROVE')
else:
    print('DENIED')





Fixed code:
N = int(input())
S = list(map(int,input().split()))
B= list()
X = list()
for i in S:
    if i % 2== 0:
        B.append(i)
for n in B:
    if n % 3 == 0 or n % 5 == 0:
        X.append(n)
if len(B) == len(X):
    print('APPROVED')
else:
    print('DENIED')