qyliang/CodeNanoFix huggingface dataset:
Buggy code:
input1 = list(map(int, (input().split())))
input2 = list(map(int, (input().split())))

n = input1[0]

for a in input2:
    if(a & 1 == 1):
        continue

    if(a % 3 == 0 or a % 5 == 0):
        print("APPROVED")
        exit(0)

print("DENIED")


Fixed code:
input1 = list(map(int, (input().split())))
input2 = list(map(int, (input().split())))

n = input1[0]

for a in input2:
    if(a & 1 == 1):
        continue

    if(a % 3 != 0 and a % 5 != 0):
        print("DENIED")
        exit(0)

print("APPROVED")
Buggy code:
n= input().split()
n = int(n)
nums= input().split()
#map(int,input().split())
state = 1
for i in range(n):
    if nums[i] &1 == 0 :
        if nums[i]%3 ==0 or nums[i]%5 ==0:
            continue
        else:
            state= 0
            #print("DENIED")
            break
if state == 1:
    print("APPROVED")
else:
    print("DENIED")

Fixed code:
n= input()
n = int(n)
nums= input().split()
#map(int,input().split())
state = 1
for i in range(n):
    if int(nums[i]) &1 == 0 :
        if int(nums[i])%3 ==0 or int(nums[i])%5 ==0:
            continue
        else:
            state= 0
            #print("DENIED")
            break
if state == 1:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
n = int(input())
m = map(int, input().split())
flag = "APPROVED"

for i in m:
  if i % 3 != 0 and i % 5 != 0:
    flag = "DENIED"
    
print(flag)

Fixed code:
n = int(input())
m = map(int, input().split())
flag = "APPROVED"

for i in m:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			flag = "DENIED"
    
print(flag)
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) or (a[i]%2==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())
l = list(map(int, input().split()))
cnt = 0
for i in l:
    if i % 6 == 0 or i % 10 == 0:
        cnt += 1
if cnt == n:
    print("APPROVED")
else:
    print("DENIED")


Fixed code:
n = int(input())
l = list(map(int, input().split()))
count = 0
cnt = 0
for j in l:
    if j % 2 == 0:
        count += 1
for i in l:
    if i % 6 == 0 or i % 10 == 0:
        cnt += 1
if cnt == count:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
n = int(input())
a = map(int, input().split())

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

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

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

    for a in A:
        if a % 2 == 0:
            if not a % 3 == 0 or a % 5 == 0:
                print('DENIED')
                return
    print('APPROVED')


if __name__ == '__main__':
    main()


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

    for a in A:
        if a % 2 == 0:
            if not (a % 3 == 0 or a % 5 == 0):
                print('DENIED')
                return
    print('APPROVED')


if __name__ == '__main__':
    main()
Buggy code:
A=input().split()
x = input().split()
target ="APPROVED"
for i in x:
  if int(i)%2 == 0:
    if int(i)%3 > 0 or int(i)%5 > 0:
      target = "DENIED"
      break
print(target)


Fixed code:
A=input().split()
x = input().split()
target ="APPROVED"
for i in x:
  if int(i)%2 == 0:
    if int(i)%3 > 0 and int(i)%5 > 0:
      target = "DENIED"
      break
print(target)
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()))

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

Fixed code:
n = int(input())
for x in list(map(int, input().split())):
  if x % 2 == 0 and x % 3 != 0 and x % 5 != 0:
    print("DENIED")
    exit()
print("APPROVED")
Buggy code:
n=int(input())
l=list(map(int, input().split()))
br=0
for i in range (n):
    if l[i]%2==0 and l[i]%5==0 or l[i]%3==0:
        br+=1
if br==n:
    print("APPROVED")
else:
    print("DENIED")


Fixed code:
n=int(input())
l=list(map(int, input().split()))
br=0
p=0
for i in range (n):
    if l[i]%2==0:
        p+=1
        if l[i]%5==0 or l[i]%3==0:
            br+=1
   
if br==p:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
N=int(input())
i = list(map(int, input().split()))
c=0

for k in range(0,N):
  if i[k]%2==0:
    if (i[k]%3!=0) or (i[k]%5!=0):
      c=c+1

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

Fixed code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
N=int(input())
i = list(map(int, input().split()))
c=0

for k in range(0,N):
  if i[k]%2==0:
    if (i[k]%3!=0) and (i[k]%5!=0):
      c=c+1

if c==0:
  print('APPROVED')
else:
  print('DENIED')
Buggy code:
N = int(input())
A = list(map(int, input().split()))

j = True
for _ in range(N):
    if A[_] % 2 == 0:
        if A[_] %3 == 0 or A[_] % 5 ==0:
            pass
        else:
            j = False
            exit()
            
if j:
    print("APPROVED")
else:
    print("DENIED") 

Fixed code:
N = int(input())
A = list(map(int, input().split()))
 
j = True
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] %3 == 0 or A[i] % 5 ==0:
            pass
        else:
            j = False
            
if j == True:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
import numpy as np
N = input()
list = list(map(int,input().split(' ')))

list = np.array(list)
A = list[list%2 == 0]
B = np.unique(np.append(list[list%6 == 0],(list[list%10 == 0])))
if A == B :
    print('APPROVED')
else:
    print('DENIED')


Fixed code:
import numpy as np
N = input()
list = list(map(int,input().split(' ')))

list = np.array(list)
A = np.unique(list[list%2 == 0])
B = np.unique(np.append(list[list%6 == 0],(list[list%10 == 0])))

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

for x in a:
  if x % 2 == 0:
    if x % 3 == 0 and x % 5 == 0:
      print('APPROVED')
      exit()

print('DENIED')  

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


Fixed code:
n = int(input())
A = list(map(int,input().split()))
res = "APPROVED"
for a in A :
    if a  % 2 == 0 :
        if a % 3 == 0 or a % 5 == 0 :
            continue
        
        res = "DENIED"
        break
    
print(res)
Buggy code:
N=int(input())
A=list(map(int,input().split()))
even=[]
for a in A:
    if a%2==0:
        even.append(a)
    else:
        print("APPROVED")
        exit()

ans=False
        
for e in even:
    if e%3==0 or e%5==0:
        ans=True
    else:
        break

print("APPROVED" if ans else "DENIED")

Fixed code:
N=int(input())
A=list(map(int,input().split()))
even=[]
for a in A:
    if a%2==0:
        even.append(a)
    
if len(even)==0:
    print("APPROVED")
    exit()
    
ans=False
    
for e in even:
    if e%3==0 or e%5==0:
        ans=True
    else:
        ans=False
        break

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

Fixed code:
n = int(input())
lst = list(map(int,input().split()))
c = 0
for i in range(n):
  if (lst[i]%2 == 0):
    if (lst[i]%3 != 0 and lst[i]%5 != 0):
      c = 1
if (c == 0):
  print("APPROVED")
else:
  print("DENIED")
Buggy code:
N = int(input())
A = list(map(int, input().split()))
B = 0
for i in range(N):
  if A[i]%6 == 0 or A[i]%10 == 0:
    continue
  elif A[i]%2 == 1:
    continue
  else:
    B = 1
print('APPROVED' if B==0 else 'DNIED')

Fixed code:
N = int(input())
A = list(map(int, input().split()))
B = 0
for i in range(N):
  if A[i]%6 == 0 or A[i]%10 == 0:
    continue
  elif A[i]%2 == 1:
    continue
  else:
    B = 1
print('APPROVED' if B==0 else 'DENIED')
Buggy code:
N=int(input())
M=list(map(int,input().split()))
S=[]
T=[]
for i in range(0,len(M)-1)  
  if M[i]%2==0:
    T.append(M[i])
    S.append(M[i])
for j in range(0,len(S)-1)
  if S[j]%3!=0 and S[j]%5!=0:
    T.remove(S[j])
if len(S)==len(T):
  print('APPROVED')
else:
  pritn('DENIED')
    

Fixed code:
N=int(input())
M=list(map(int,input().split()))
S=[]
T=[]
for i in range(0,len(M))  :
  if M[i]%2==0:
    T.append(M[i])
    S.append(M[i])
for j in range(0,len(S)):
  if S[j]%3!=0 and S[j]%5!=0:
      T.remove(S[j])
    
if len(S)==len(T):
  print('APPROVED')
else:
  print('DENIED')
Buggy code:
N = int(input())
A = list(map(int, input().split()))
A_even = [i for i in A if i % 2 == 0]
flag_list = list(map(lambda x: (x % 3 == 0) or (x % 5 == 0), A_even))
print('APPROVED' if False not in flag_list else 'DENIDE')

Fixed code:
N = int(input())
A = list(map(int, input().split()))
A_even = [i for i in A if i % 2 == 0]
flag_list = list(map(lambda x: (x % 3 == 0) or (x % 5 == 0), A_even))
print('APPROVED' if False not in flag_list else 'DENIED')
Buggy code:
N = int(input())
A = list(map(int, input().split()))
for a in A:
  if a % 2 == 1:
    continue
    if a / 3 == 0 or a / 5 == 0:
      continue
      print("DENIED")
      exit()
print("APPROVED")

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

f = True
for a in A_list:
  if a % 2 == 1:
    continue
  elif a % 3 == 0 or a % 5 == 0:
    continue
    
if f:
  print("ACCEPTED")
else:
  print("DENIED")

Fixed code:
N = int(input())
A_list = list(map(int, input().split()))
 
f = True
for a in A_list:
  if a % 2 == 1:
    continue
  elif a % 3 == 0 or a % 5 == 0:
    continue
  else:
    f = False
    
if f:
  print("APPROVED")
else:
  print("DENIED")
Buggy code:
N = int(input())
L = list(map(int, input().split()))

ans = "APPROVED"
for i in range(N):
  if L[i]%2 == 0:
    if L[i]%3 == 0 and L[i]%5 == 0:
      pass
    else:
      ans = "DENIED"
      break
      
print(ans)
      

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

ans = "APPROVED"
for i in range(N):
  if L[i]%2 == 0:
    if L[i]%3 == 0 or L[i]%5 == 0:
      pass
    else:
      ans = "DENIED"
      break
      
print(ans)
Buggy code:
# -*- codong:utf-8 -*-
N=int(input())
A=list(map(int,input().split()))
ans1=0
ans2=0
for i in range(N):
    if A[i]%2==0:
        ans1=1
        if A[i]%3==0 or A[i]%5==0:
            ans2=1
if ans1==0 or ans2==1:
    print("APPROVED")
else:
    print("DENIED")

Fixed code:
# -*- codong:utf-8 -*-
N=int(input())
A=list(map(int,input().split()))
ans1=0
ans2=0
for i in range(N):
    if A[i]%2==0:
        ans1=1
        if A[i]%3!=0 and A[i]%5!=0:
            ans2=1
if ans2!=1:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
N = int(input())
A = [int(i) for i in input().split()]

Frag = True

for i in range(N):
    if A[i] % 2 == 1 or A[i] % 6 == 0 or A[i] % 10 == 0:
        continue
    else:
        Frag == False

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

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

Frag = True

for i in range(N):
    if A[i] % 2 == 1 or A[i] % 6 == 0 or A[i] % 10 == 0:
        pass
    else:
        Frag = False

if Frag == True:
    print("APPROVED")
else:
    print("DENIED")
Buggy code:
n = int(input())
l = list(map(int,input().split()))

flag = True
for i in l:
  if (i%3 != 0 and i%2 == 0) or (i%5 != 0 and i%2 == 0):
    flag = False
    break
    
if flag:
  print("APPROVED")
  
else:
  print("DENIED")

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

flag = True
for i in l:
  if (i%3 != 0 and i%2 == 0) and (i%5 != 0 and i%2 == 0):
    flag = False
    break
    
if flag:
  print("APPROVED")
  
else:
  print("DENIED")
Buggy code:
from sys import exit
n = int(input())
a = list(map(int, input().split()))
b = "APPROVED"
while b == "APPROVED":
  for i in a:
    if i % 2 == 0:
      if (i % 3 == 0 or i % 5 == 0):
        b = "APPROVED"
      else:
        print("DENIED")
        exit()
  
print(b)

Fixed code:
from sys import exit
n = int(input())
a = list(map(int, input().split()))
b = "APPROVED"
while b == "APPROVED":
  for i in a:
    if i % 2 == 0:
      if (i % 3 == 0 or i % 5 == 0):
        b = "APPROVED"
      else:
        print("DENIED")
        exit()
  break
print(b)
Buggy code:
input()
v = list(map(int, input().strip().split()))
if all(i & 1 or i % 3 or i % 5 for i in v): print('APPROVED')
else: print('DENIED')


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

    flag = True
    for i in range(N):
        if A[i] % 2 == 0:
            if A[i] % 3 == 0 or A[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(' ')))
flag = True
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            pass
        else:
            flag = False

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:
        even_num.append(i)
for j in range(len(even_num)):
    if even_num[j] % 3 != 0 and even_num[j] % 5 != 0:
        print('DENIED')
        exit()
print('APPROVED')

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

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

Fixed code:
n = int(input())
a = list(map(int, input().split()))
for i in a:
    if i % 2 == 1:
        continue
    if i % 3 == 0 or i % 5 == 0:
        continue
    print("DENIED")
    exit()
print("APPROVED")
Buggy code:
n = int(input())
num = list(map(int, input().split()))

for i in range(n):
  if num[i]%2==0:
    if num[i]%3!=0 or num[i]%5!=0:
      print('DENIED')
      exit()
      
print('APPROVED')
  

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

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

flag = False
for i in range(N):
  if nums[i]%2 == 0:
    continue
  elif nums[i]%3 == 0:
    continue
  elif nums[i]%5 == 0:
    continue
  else:
    print('DENIED')
    flag = True
    break
if flag == False:
  print('APPROVED')

Fixed code:
N = int(input())
nums = list(map(int, input().split(' ')))
flag = False
for i in range(N):
  if nums[i]%2 == 0 :
    
    if (nums[i]%3 != 0) & (nums[i]%5 != 0):
      flag = True
      print('DENIED')
      break
    else:
      continue
  else:
    continue
if flag == False:
  print('APPROVED')
Buggy code:
n=int(input())
x = map(int, input().split())

for i in x :
    if i % 2 == 0 :
      if  i % 3!=0 or i % 5 !=0:
        print('DENIED')
        exit()

print('APPROVED')




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

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

print('APPROVED')
Buggy code:
N = input()

a =  list(map(int,input().split()))
b = 0
c = 0
for i in range(len(a)):
    if a[i] % 2 == 0:
        b+=1
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            c+=1
        if b == c:
            print('APPROVED')
        else:
            print('DENIED')

Fixed code:
N = input()

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

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

    for i in odds:
        if i % 3 != 0 and i % 5 != 0:
            print("DENIED")
            return

    print("APPROVED")


def main1():
    _ = int(input())
    a = list(map(int, input().split()))
    odds = filter(lambda x: x % 2 == 0, a)
    denied = filter(lambda x: x % 3 != 0 and x % 5 != 0, odds)
    if denied:
        print("DENIED")
    else:
        print("APPROVED")
        

if __name__ == "__main__":
    main1()


Fixed code:
def main():
    _ = int(input())
    a = list(map(int, input().split()))
    odds = []
    for i in a:
        if i % 2 == 0:
            odds.append(i)

    for i in odds:
        if i % 3 != 0 and i % 5 != 0:
            print("DENIED")
            return

    print("APPROVED")


def main1():
    _ = int(input())
    a = list(map(int, input().split()))
    odds = list(filter(lambda x: x % 2 == 0, a))
    denied = list(filter(lambda x: x % 3 != 0 and x % 5 != 0, odds))
    if denied:
        print("DENIED")
    else:
        print("APPROVED")


if __name__ == "__main__":
    main1()
Buggy code:
##======================================python3
''' ===========================================
## null
##
##
=========================================== '''
import sys
from sys import stdin #read(), readline()
input = stdin.readline
import heapq #heappush(trgt, val) heappop(trgt) trgt[0] __lt__<
sys.setrecursionlimit(10**6)
INF = 1<<50

if __name__ == '__main__':
    n = int(input())
    
    chk = True;
    
    iip = list(map(int, input().split(' ')))
    for i in range(n):
        a = iip[i]
        if a&1 == 0:
            if a%3 == 0 or a%5 == 0:
                continue;
            else:
                chk = False;
                break;
        else:
            continue;
    
    if chk == True:
        print("APPROVED")
    else:
        print(DENIED)
    

Fixed code:
##======================================python3
''' ===========================================
## null
##
##
=========================================== '''
import sys
from sys import stdin #read(), readline()
input = stdin.readline
import heapq #heappush(trgt, val) heappop(trgt) trgt[0] __lt__<
sys.setrecursionlimit(10**6)
INF = 1<<50

if __name__ == '__main__':
    n = int(input())
    
    chk = True;
    
    iip = list(map(int, input().split(' ')))
    for i in range(n):
        a = iip[i]
        if a&1 == 0:
            if a%3 == 0 or a%5 == 0:
                continue;
            else:
                chk = False;
                break;
        else:
            continue;
    
    if chk == True:
        print("APPROVED")
    else:
        print("DENIED")
Buggy code:
n = int(input().split())
for a in list(map(int, input().split())):
  if a % 2 == 0:
    if a % 3 != 0 and a % 5 != 0:
      print('DENIED')
      break
else:
  print('APPROVED')

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

print("APPROVED")
Buggy code:
a = input()
num = [int(x) for x in input().split()]
flag = True
for x in num:
  if x % 2 == 0:
    if x % 3 != 0 and x % 5 != 0:
      flag = False
if flag:
  print('APPROVE')
else:
  print('DENIED')

Fixed code:
a = input()
num = [int(x) for x in input().split()]
flag = True
for x in num:
  if x % 2 == 0:
    if x % 3 != 0 and x % 5 != 0:
      flag = False
if flag:
  print('APPROVED')
else:
  print('DENIED')
Buggy code:
N=int(input())
flag=True
nums=list(map(int, input().split()))
for x in nums:
  if x%2:
    continue
  else:
    if x%3==0 and x%5==0:
      continue
    else:
      flag=False
      break
if flag:
  print("APPROVED")
else:
  print("DENIED")
  

Fixed code:
N=int(input())
flag=True
nums=list(map(int, input().split()))
for x in nums:
  if x%2:
    continue
  else:
    if x%3==0 or x%5==0:
      continue
    else:
      flag=False
      break
if flag:
  print("APPROVED")
else:
  print("DENIED")
Buggy code:
import numpy as np

N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 == 0 or a[i]%5== 0:
            count += 1

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

Fixed code:
import numpy as np
 
N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

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

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