qyliang/CodeNanoFix huggingface dataset:
Buggy code:

n=int(input())
a=list(map(int,input().split()))
for i in range(len(a)):
    if a[i]%2==0:
        if 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:
    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()))
ans="APPROVED"
for i in range(n):
  if a[i]%2==0 and a[i]%3!=0 or a[i]%5!=0:
    ans="DENIED"
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 and a[i]%3!=0 and a[i]%5!=0:
    ans="DENIED"
print(ans)
Buggy code:
n=int(input())
A=list(map(int,input().split()))
ans="DENIED"
for i in A:
    if i%2==0:
        if i%3==0 or i%5==0:
            ans="APPROVED"
            print(ans)
            break
print(ans)
            


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

Fixed code:
N = int(input())
A = list(map(int, input().split()))
judge = 0
for i in range(N):
    if A[i] % 2 == 1:
        continue
    elif A[i]%3 == 0 or A[i]%5 == 0:
        judge += 0
    else:
        judge += 1
print('APPROVED' if judge == 0 else 'DENIED')
Buggy code:
n=int(input())
a=list(map(int,input().split()))
f=0
for i in range(n):
    if(a[i]%2==0):
        if(a[i]%3==0 or a[i]%5==0):
            f=0
        else:
            f=1
            break
if(f==0):
    print("APROVED")
else:
    print("DENIED")

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

Fixed code:
N = input()
A = list(map(int, input().split()))
print('APPROVED' if all(a & 1 or a % 3 == 0 or a % 5 == 0 for a in A) else 'DENIED')
Buggy code:
n = int(input())
a = list(map(int, input().split()))

flg = True
for i in range(n):
  if a[i]%2 == 0:
    cnt += 1
    if a[i]%3 == 0 or a[i]%5 == 0:
      pass
    else:
      flg = False
if flg: print("APPROVED")
else: print("DENIED")

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

flg = True
for i in range(n):
  if a[i]%2 == 0:
    if a[i]%3 == 0 or a[i]%5 == 0:
      pass
    else:
      flg = False
if flg: print("APPROVED")
else: print("DENIED")
Buggy code:
N = int(input())
A=list(map(int,input().split()))
B=[i for i in A if i%2==0]
x=0
for j in B :
    if (j%3==0) or (j%5)==0:
        x +=1
    else:
        print("DINIED")
        break
if x==len(B):
    print("APPROVED")


Fixed code:
N = int(input())
A=list(map(int,input().split()))
B=[i for i in A if i%2==0]
x=0
for j in B :
    if (j%3==0) or (j%5)==0:
        x +=1
    else:
        print("DENIED")
        break
if x==len(B):
    print("APPROVED")
Buggy code:
N = int(input())
A = list(map(int, input().split()))
for a in A:
    if a % 2 == 0 and (a % 3 != 0 and a % 5 != 0):
        print('DENIED')
    else:
        print('APPROVED')

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

approved = True
for a in A:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            approved = False
if approved:
    print('APPROVED')
else:
    print('DENIED')
Buggy code:
n = int(input())
nums = [int(i) for i in input().split(" ")]

approved = True
for num in nums:
  if num%2 == 0:
    approved = (num%3 == 0) & (num%5 == 0)
if approved:
  print('APPROVED')
else:
  print('DENIED')
  

Fixed code:
n = int(input())
nums = [int(i) for i in input().split(" ")]

approved = True
for num in nums:
  if num%2 == 0:
    approved = approved & ((num%3 == 0) or (num%5 == 0))
if approved:
  print('APPROVED')
else:
  print('DENIED')
Buggy code:
n=int(input())
a=list(map(int,input().split()))
cnt=0
while True:
    if cnt>=n:
        print('DENIED')
        break
        
    elif a[cnt]%2==0:
        if a[cnt]%3==0 or a[cnt]%5==0:
            cnt+=1
            continue
        else:
            print('DENIED')
            break
    elif cnt==n:
        print('APPROVED')
        break
    else:
        cnt+=1
        continue
    

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

if flg == 1:
    print("APROVED")
else:
    print("DENIED")

Fixed code:
N = int(input())
A = list(map(int,input().split()))
flg = 1
for i in A:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 !=0:
            flg = 0
            break

if flg == 1:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
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')
            break
else:
    print('APPROVED')
    break

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

flag = 0
for num in range(N):
    tmp = A[num]
    flag = 0 if (tmp%2==0 and (tmp%3==0 or tmp%5==0)) or tmp%2==1 else 1

ans = 'APPROVED' if flag==0 else 'DENIED '
print(ans)

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

flag = 0
for num in range(N):
    tmp = A[num]
    flag = 0 if (tmp%2==0 and (tmp%3==0 or tmp%5==0)) or tmp%2==1 else 1
    if flag == 1:
        break

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

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

for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            N -= 1
    else:
        N -= 1

if N == 0:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
'''input
3
28 27 24
'''
n = input()
a = map(int, input().split())

ok = 0
for i in a:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			ok = 0

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

Fixed code:
'''input
3
28 27 24
'''
n = input()
a = map(int, input().split())

ok = 1
for i in a:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			ok = 0

if ok == 1:
	print("APPROVED")
else:
	print("DENIED")
Buggy code:
N = int(input())
A = list(map(int, input().split()))

ans = "APPROVED"
for a in A:
    if (a % 2 == 0) and (a & 3 != 0) and (a % 5 != 0):
        ans = "DENIED"
        break

print(ans)

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

ans = "APPROVED"
for a in A:
    if (a % 2 == 0) and (a % 3 != 0) and (a % 5 != 0):
        ans = "DENIED"
        break

print(ans)
Buggy code:
n = input()
l = input().split() 
l = [int(x) for x in l]
for i in range(len(l)):
    if l[i] % 2 == 0 and (l[i]%3 ==0 or l[i]%5==0):
        print("APPROVED")
    else:
        print("DENIED") 

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

Fixed code:
n=int(input())
a=list(map(int,input().split()))
x=0
for i in range(n):
    if a[i]%2==0:
        if a[i]%3!=0 and a[i]%5!=0:
            x=1
            break
if x==1:
    print('DENIED')
else:
    print('APPROVED')
Buggy code:
n = int(input())
l = list(int(x) for x in input().split())
a = []
for i in l:
    if i % 2 == 0:
        a.append(i)
print(l)
if len(a) == sum([i % 3 == 0 or i % 5 == 0 for i in a]):
    print('APPROVED')
elif len(a) == 0:
    print('DENIED')
else:
    print('DENIED')

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

if len(a) == sum(x):
    print('APPROVED')
elif len(a) == 0:
    print('DENIED')
else:
    print('DENIED')
Buggy code:
N = int(input())
An = list(map(int,input().split()))

for i in An:
    if i%2==0:
        if i%3 !=0 and i%5==0:
            print('DENIED')
            exit()
else:
    print('APPROVED')


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

for i in An:
    if i%2==0:
        if i%3 !=0 and i%5!=0:
            print('DENIED')
            exit()
else:
    print('APPROVED')
Buggy 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')

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:
i1 = int(input())
i2 = list(map(int, input().split()))
    
l = []
for i in range(i1):
  if i2[i] % 2 == 0:
    if i2[i] % 3 == 0 or i2[i] % 5 == 0:
        l.append('APPROVED')
    else:
        l.append('DENEID')

if 'DENEID' in l:
  	print('DENEID')
else:
  	print('APPROVED')

Fixed code:
i1 = int(input())
i2 = list(map(int, input().split()))
    
l = []
for i in range(i1):
  if i2[i] % 2 == 0:
    if i2[i] % 3 == 0 or i2[i] % 5 == 0:
        l.append('APPROVED')
    else:
        l.append('DENEID')
    
if (all(str == 'APPROVED' for str in l)):
	print('APPROVED')
else:
  	print('DENIED')
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 A[i]%5==0:
    else:
      flag=1
print(['APPROVED','DENIED'][flag])

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
print(['APPROVED','DENIED'][flag])
Buggy code:
n = int(input())
anums = list(map(int, input().split()))

for anum in anums:
    if (anum % 2 == 0) and ((anum % 3 == 0) or (anum % 5 == 0)):
        result = 'APPROVED'
        break
    else:
        result = 'DENIED'

print(result)


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

result = 'APPROVED'
for anum in anums:
    if (anum % 2 == 0) and not ((anum % 3 == 0) or (anum % 5 == 0)):
        result = 'DENIED'
        break

print(result)
Buggy code:
import sys

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


def main():
    N = int(readline())
    A = list(map(int, readline().split()))

    def judge():
        for x in A:
            if x % 2 == 0:
                if x % 3 != 0 or x % 5 != 0:
                    return False
        return True

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


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():
    N = int(readline())
    A = list(map(int, readline().split()))

    def judge():
        for x in A:
            if x % 2 == 0:
                if (x % 3 != 0) and (x % 5 != 0):
                    return False
        return True

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


if __name__ == '__main__':
    main()
Buggy code:
n = int(input())
a = list(int(input().split()))
ret = 'APPROVED'
for i in a:
    if i%2 == 0:
        if i%3 != 0 and i%5 != 0:
            ret = 'DENIED'
            break
print(ret)

Fixed code:
n = int(input())
a = list(map(int, input().split()))
ret = 'APPROVED'
for i in a:
    if i%2 == 0:
        if i%3 != 0 and i%5 != 0:
            ret = 'DENIED'
            break
print(ret)
Buggy code:
N=input();print('DENIED'if any([x%2==0 and(x%3andx%5)for x in map(int,input().split())])else'APPROVED')

Fixed code:
N=input();print('DENIED'if any([x%2==0 and(x%3 and x%5)for x in map(int,input().split())])else'APPROVED')
Buggy code:
N=int(input())
print('DENIED' if any([x%2==0 and (x%3 and x%5) for x in int(input().split())]) else 'APPROVED')

Fixed code:
N=int(input())
print('DENIED' if any([x%2==0 and (x%3 and x%5) for x in map(int,input().split())]) else 'APPROVED')
Buggy code:
import sys
N = int(input())
A = [int(i) for i in input().split()]
for i in A:
  if not i%3 == 0 or not i % 5 == 0:
    print("DENIED")
    sys.exit()
  else :
    continue
print("APPROVED")

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


if s==0:
    print('APPROVED')
else:
    print('DENID')

Fixed code:
n=int(input())
a=list(map(int,input().split()))
s=0
for i in range(n):
    if a[i]%2==0 and a[i]%3!=0 and a[i]%5!=0:
        s=s+1


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

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

Fixed code:
_ = 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:
n = int(input())
numberlist =  list(map(int, input().split()))
ans = 'DENIED'
for i in range(n):
    if numberlist[i] % 2 == 0:
        if numberlist[i] % 3 == 0 or numberlist[i] % 5 == 0:
            ans = 'APPROVED'
print(ans)

Fixed code:
n = int(input())
numberlist =  list(map(int, input().split()))
ans = 'APPROVED'
for i in range(n):
    if numberlist[i] % 2 == 0:
        if numberlist[i] % 3 == 0 or numberlist[i] % 5 == 0:
            ans = 'APPROVED'
        else:
            ans = 'DENIED'
            break
print(ans)
Buggy code:
import sys

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

a_even = [i for i in a if i%2==0]
# print(a_even)
for x in a_even:
    if x%3==0 or x%5==0:
        pass
    else:
        print('DENIED')
        print(x)
        sys.exit()
print('APPROVED')

Fixed code:
import sys

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

a_even = [i for i in a if i%2==0]
# print(a_even)
for x in a_even:
    if x%3==0 or x%5==0:
        pass
    else:
        print('DENIED')
        # print(x)
        sys.exit()
print('APPROVED')
Buggy code:
n = int(input())
m = list(map(int,input().split()))
f = True
for i in m:
  if i % 2 == 0:
    if (i % 3 == 0 ) or (i % 5 == 0 ):
      f = True
    else:
      f = False
if f :
  print('APPROVED')
else:
  print('DENIED')

Fixed code:
n = int(input())
m = list(map(int,input().split()))
f = True
for i in m:
  if i % 2 == 0:
    if (i % 3 == 0 ) or (i % 5 == 0 ):
      f = True
    else:
      print('DENIED')
      exit()

print('APPROVED')
Buggy code:
def main():  
  N=input()
  A=list(map(int,input().split()))
  for a in A:
    if a%2==0 and  (a%3!=0 or a%5!=0):
      print("DENIED")
      return 
  print("APPROVED")

main()
    

Fixed code:
def main():  
  N=input()
  A=list(map(int,input().split()))
  for a in A:
    if a%2==0 and  (a%3!=0 and a%5!=0):
      print("DENIED")
      return 
  print("APPROVED")

main()
Buggy code:
N = int(input())
A = map(int,input().split())
for a in A:
  if a % 2 == 0 and A % 3 != 0 and A % 5 != 0:
    print('DENIED')
    exit()
print('APPROVED')

Fixed code:
N = int(input())
A = map(int,input().split())
for a in A:
  if a % 2 == 0 and 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 range(N):
    print(i)
    print(A[i] % 2 == 0)
    print(A[i] % 3 != 0)
    print(A[i] % 5 != 0)
    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()))

F = 0

for i in range(N):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 or a[i] % 5 != 0:
      F = 1
      
if F == 1:
  print('DENIED')
else:
  print('APPROVED')
      



Fixed code:
N = int(input())

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

F = 0

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

check = 0
for i in range(n) :
  if a[i]%2 == 0 :
    if a[i]%3 == 0 or a[i]%5 == 0 :
      continue
    else :
      check = 1

if check == 0 :
  print('APPROVED')
else :
  print('DENIDE')

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

check = 0
for i in range(n) :
  if a[i]%2 == 0 :
    if a[i]%3 == 0 or a[i]%5 == 0 :
      continue
    else :
      check = 1

if check == 0 :
  print('APPROVED')
else :
  print('DENIED')
Buggy code:
n = int(input())
a = list(map(int,input().split()))
flag = 0

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


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

for i in a:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      flag = 1
    else:
      flag = 0
      break
  
if flag == 1:
  print('APPROVED')
else:
  print('DENIED')
Buggy code:
n = int(input())
A = list(map(int, input().split()))

ans = 'APPROVED'
for a in A:
  if a%1 == 0:
    continue
  else:
    if a%3 == 0:
      continue
    elif a%5 == 0:
      continue
    else:
      ans = 'DENIED'
      
print(ans)

Fixed code:
n = int(input())
A = list(map(int, input().split()))
 
ans = 'APPROVED'
for a in A:
  if a%2 == 1:
    continue
  else:
    if a%3 == 0:
      continue
    elif a%5 == 0:
      continue
    else:
      ans = 'DENIED'
      break
      
print(ans)
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 or A[i]%5==0:
      print('APPROVED')
      exit()

print('DENIED')

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())
A = list(map(int,input().split()))
ans = 'APPROVED'
for a in A:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            ans = 'DENIED'
            exit()
print(ans)

Fixed code:
N=int(input())
A=list(map(int,input().split()))
r="APPROVED"
for a in A:
  if a%2==0 and (a%3!=0 and a%5!=0):
    r="DENIED"
print(r)
Buggy code:
N = int(input())
A = list(map(int, input().split())
for a in A:
  if a % 2 == 0 and (a % 3 != 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 and ( a%3 != 0 and a%5 != 0 ):
        print('DENIED')
        exit()
print('APPROVED')
Buggy code:
N=int(input())
A=list(map(int,input().split()))
lis=[]
flag=1

for i in A:
  if i%2==0:
    lis.append(i)
    
for j in lis:
  if j%3!=0 and j%5!=0:
    flag=0
print("DENIED"if flag==0 else "APPROVE")

Fixed code:
N=int(input())
A=list(map(int,input().split()))
lis=[]
flag=1

for i in A:
  if i%2==0:
    lis.append(i)
    
for j in lis:
  if j%3!=0 and j%5!=0:
    flag=0
print("DENIED"if flag==0 else "APPROVED")
Buggy code:
#!/usr/bin/env python3
import numpy as np
stdin = open(0)

A = np.fromstring(stdin.read(),np.int64,sep= ' ')[1:]
A=A[A%2 ==0]
if np.all((A % 3 == 0)|(A % 5 ==0)):
    print('APPROVED')
else:
    print('DENITED')

Fixed code:
#!/usr/bin/env python3
import numpy as np
stdin = open(0)

A = np.fromstring(stdin.read(),np.int64,sep= ' ')[1:]
A=A[A%2 ==0]
if np.all((A % 3 == 0)|(A % 5 ==0)):
    print('APPROVED')
else:
    print('DENIED')
Buggy code:
n = int(input())
a = [int(i) for i in input().split()]
ok = True
for i in a :
    if((i%3 != 0) and (i%5 != 0) and (i%2 == 0)) :
        ok = False
        print(i)
if ok == True:
    print("APPROVED")
else :
    print("DENIED")


Fixed code:
n = int(input())
a = [int(i) for i in input().split()]
ok = True
for i in a :
    if( (i%2 == 0) and (i%3 != 0) and (i%5 != 0)) :
        ok = False
if ok == True:
    print("APPROVED")
else :
    print("DENIED")
Buggy code:
N = int(input())
lst = input().split(' ')
good = False
for v in lst:
  if int(v) % 2 != 0:
    continue
  elif int(v) % 3 != 0 and int(v) % 5 != 0:
    print('DENIED')
    break
  else:
    good = True
if good:
  print('APPROVE')

Fixed code:
N = int(input())
lst = input().split(' ')
for v in lst:
  good = False
  if int(v) % 2 != 0:
    good = True
  elif int(v) % 3 != 0 and int(v) % 5 != 0:
    print('DENIED')
    break
  else:
    good = True
if good:
  print('APPROVED')
Buggy 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] % 6 != 0 and A[i] % 10 != 0:
    print(A[i])
    ans = 'DENIED'
    break

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 and A[i] % 6 != 0 and A[i] % 10 != 0:
    ans = 'DENIED'
    break

print(ans)
Buggy code:
def check(number):
    if number % 2 == 1:
        return True
    if number % 3 == 0 and number % 5 == 0:
        return True
    return False


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

flag = True

for num in array:
    if check(num) is False:
        flag = False
        break

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

Fixed code:
def check(number):
    if number % 2 == 1:
        return True
    if number % 3 == 0 or number % 5 == 0:
        return True
    return False


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

flag = True

for num in array:
    if check(num) is False:
        flag = False
        break

if flag:
    print("APPROVED")
else:
    print("DENIED")
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
      

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")
      exit()
  else:
    continue
print("APPROVED")