Problem:
 Score: 200 points    Problem Statement  You are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.  According to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied:   All even numbers written on the document are divisible by 3 or 5 .   If the immigrant should be allowed entry according to the regulation, output APPROVED ; otherwise, print DENIED .      Notes   The condition in the statement can be rephrased as "If x is an even number written on the document, x is divisible by 3 or 5 ".
Here " if " and " or " are logical terms.       Constraints   All values in input are integers.  1 \leq N \leq 100  1 \leq A_i \leq 1000         Input  Input is given from Standard Input in the following format:  N  A_1  A_2  \dots  A_N       Output  If the immigrant should be allowed entry according to the regulation, print APPROVED ; otherwise, print DENIED .        Sample Input 1 5
6 7 9 10 31      Sample Output 1 APPROVED  The even numbers written on the document are 6 and 10 .  All of them are divisible by 3 or 5 , so the immigrant should be allowed entry.       Sample Input 2 3
28 27 24      Sample Output 2 DENIED  28 violates the condition, so the immigrant should not be allowed entry.

Solution (Python):
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 or a[i]%5==0:
      pass
    else:
      count+=1
if count==0:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):

"""
Created on Thu May  7 22:21:06 2020

@author: shinba
"""
import sys

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

for i in A:
    if i % 2 == 0:
        if (i % 5 != 0) and (i % 3 != 0):
            break
else:
    print("APPROVED")
    sys.exit()
    
print("DENIED")

Solution (Python):
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 == 0:
            continue
        elif A[i] % 5 == 0:
            continue
        else:
            print("DENIED")
            sys.exit(0)
print("APPROVED")

Solution (Python):
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")

Solution (Python):
n = int(input())
a = map(int,input().split())

num = [i for i in a if i % 2 == 0]

for i in num :
    if i % 3 == 0 or i % 5 == 0:
        continue
    else:
        print("DENIED")
        exit()
print("APPROVED")

Solution (Python):
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")

Solution (Python):
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()
print("APPROVED")

Solution (Python):
n=int(input())
a_ = list(map(int,input().split()))

flag = True
for i in a_:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            flag = False

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

Solution (Python):
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:
            continue
        else:
            flg = False
            break

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

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
C1 = 0
C2 = 0
for i in range(N):
    if A[i] % 2 == 0 :
        C1 += 1
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            C2 += 1
if C1 == C2:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
n = int(input())

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

Alist = [x for x in A if x%2==0]

ans = []
for x in Alist:
    if x%3==0 or x%5==0:
        ans.append(True)
    else:
        ans.append(False)
        break
if all(ans)==True:    
    print("APPROVED") 
else:
    print("DENIED")

Solution (Python):
N = int(input())
number_list = list(map(int,input().split()))
count = 0
for i in range(N):
    if number_list[i]%6==0 or number_list[i]%10==0:
        count+=1
    elif number_list[i]%2==1:
        count+=1

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

Solution (Python):
from sys import stdin, setrecursionlimit


def main():
    n = int(stdin.readline())
    a = list(map(int, stdin.readline().split()))

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


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
b=[]
for aa in a:
  if aa%2==0:
    b.append(aa)
if all(bb%3==0 or bb%5==0 for bb in b):
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
g_count = 0
n_count = 0
for i in a:
  if (i % 2) == 0:
    g_count += 1
    if (i % 3) == 0 or (i % 5) == 0:
      n_count += 1
if g_count == n_count:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
import collections
import itertools as it
import math
import numpy as np








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')
      break
else:
  print('APPROVED')

Solution (Python):
a=int(input())
b=list(map(int,input().split()))
c=[i for i in b if i%2==0]
d=len(c)
e=[j for j in c if j%3==0 or j%5==0]
f=len(e)
if d==f:
       print('APPROVED')
else:
       print('DENIED')

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

yoki = dame = d = 0

for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            yoki += 1
        else:
            dame += 1
    else :
        d += 1

if dame >= 1:
    print("DENIED")
elif yoki >= 1 or d >= 1:
    print("APPROVED")

Solution (Python):
N=int(input())
A=list(map(int,input().split()))

a=True
for i in range(N):
    if A[i]%2==0:
        if A[i]%3!=0 and A[i]%5!=0:
            print("DENIED")
            a=False
            break
if a==True:
    print("APPROVED")

Solution (Python):
n = int(input())

a = input().split()

f = 'True'

for i in a:
  if int(i) % 2 == 0:
    if int(i) % 3 != 0 and int(i) % 5 != 0:
      f = 'False'

if f == 'True':
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
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")

Solution (Python):
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 != 0 and A[i] % 5 != 0:
            print('DENIED')
            sys.exit()
print('APPROVED')

Solution (Python):
N=int(input())
a=list(map(int, input().split()))

i=0             
while i<N:
        if a[i]%2==0 and (a[i]%3 !=0 and a[i]%5 !=0):
                print('DENIED')
                break
        i+=1
if i==N:
        print('APPROVED')

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
A = [a for a in A if a % 2 == 0]

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

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
a_eve = [i for i in a if i%2 == 0]
a_ans = [i for i in a_eve if i%3 != 0 and i%5 != 0]
if a_ans == []:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):


N = int(input())
A = [int(a) for a in input().split()]

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

print(ans)

Solution (Python):
n = int(input())
a_list = list(map(int, input().split()))

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

Solution (Python):
def solve():
    N = int(input())
    A = list(map(int,input().split()))
    for B in A:
        if B % 2 == 0:
            if B % 3 != 0 and B % 5 != 0:
                print('DENIED')
                exit()
    print('APPROVED')


if __name__ == '__main__':
    solve()

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  
def Is(): return map(int, input().split())  
def LI(): return list(map(int, input().split()))  
def TI(): return tuple(map(int, input().split()))  
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  
def LS(): return list(input())  
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

n = I()
A = LI()

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

print("APPROVED")

Solution (Python):
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")

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
A2 = []
for i in A :
    if i % 2 == 0:
        A2.append(i)
cnt = 0 
for j in A2:
    if j % 3 == 0 or j % 5 == 0:
        cnt += 1
if cnt == len(A2):
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
n = int(input())
A = [int(i) for i in readline().split()]

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

Solution (Python):
n = int(input())
ar = list(map(int, input().split()))
for i in ar:
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      print('DENIED')
      break
else:
  print('APPROVED')

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
ans = "APPROVED"

for i in a:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            continue
        else:
            ans = "DENIED"
            break

print(ans)

Solution (Python):
app = "APPROVED"
ng = "DENIED"

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

ok = True

for i, a in enumerate(A):
    if a % 2 == 0 and a % 3 != 0 and a % 5 != 0:
        ok = False

if ok:
    print(app)
else:
    print(ng)

Solution (Python):
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 or A[i] % 5 == 0:
      cnt += 1
    else:
      pass
  else:
    cnt += 1

if cnt == N:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
K = []

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

for m in K:
    if not (m%3 == 0 or m%5 == 0):
        print('DENIED')
        exit()

print('APPROVED')

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
for i in range(0,N,1):
    if A[i]%2 == 0:
        if A[i]%3 != 0 and A[i]%5 != 0:
            print("DENIED")
            exit()
print("APPROVED")

Solution (Python):
import sys
input = sys.stdin.readline


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

    ans = "APPROVED"
    for a in A:
        if a % 2 == 0:
            if not (a % 3 == 0 or a % 5 == 0):
                ans = "DENIED"

    print(ans)


if __name__ == "__main__":
    main()

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

g = 0
ans = 0

for i in a:
    if i % 2 == 0:
        g += 1
        if i % 3 == 0 or i % 5 == 0:
            ans += 1

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

Solution (Python):
import numpy as np
from collections import defaultdict

n = int(input())
a = np.array(list(map(int, input().split())))
memo = defaultdict(int)

a = a[np.where(a%2==0)]

for i in range(len(a)):
    if a[i] % 3 == 0:
        memo[i] += 1
    elif a[i] % 5 == 0:
        memo[i] += 1

print("APPROVED") if sum(memo.values()) == len(a) else print("DENIED")

Solution (Python):
N = int(input())
A = [int(_) for _ in input().split()]
flag = True
for a in A:
    if a % 2 == 1:
        continue
    if a % 3 == 0 or a % 5 == 0:
        continue
    flag = False
    break
if flag:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
n = int(input())
A = list(map(int, input().split()))

ans = 'APPROVED'
for i in A:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            continue
        else:
            ans = 'DENIED'

print(ans)

Solution (Python):
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")

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
flag = True
for i in range(n):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 and a[i] % 5 != 0:
      flag = False

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

Solution (Python):
n = int(input())

a = tuple(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")

Solution (Python):
if __name__ == '__main__':
	N = int(input())
	A = [int(a) for a in input().split()]
	c = 0
	for a in A:
		if a % 2 == 0:
			if a % 3 != 0 and a % 5 != 0:
				c = 1

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

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
ans="APPROVED"
for i in a:
    if(i%2==0):
        if(i%3==0 or i%5==0):continue
        else:
            ans="DENIED"
            break
print(ans)

Solution (Python):
N=int(input())
L=list(map(int,input().split()))
M=[]
for i in L:
  if i%2==0:
    M.append(i)
A='APPROVED'
for k in M:
  if k%3!=0 and k%5!=0:
    A='DENIED'
    break
print(A)

Solution (Python):
import sys
n=int(input())
a=list(map(int,input().split()))
A=[]
for i in range(len(a)):
    if a[i]%2==0:
        A.append(a[i])
B=[]
for i in range(len(A)):
    if A[i]%3!=0:
        B.append(A[i])
C=[]
for i in range(len(B)):
    if B[i]%5!=0:
        C.append(B[i])
if len(C)>=1:
    print("DENIED")
else:
    print("APPROVED")

Solution (Python):
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'
            break
print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
flag = True
odd = []
for i in a:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            continue
        else:
            flag = False
if flag:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
i=0
for i in range(N):
  if A[i]%2==1 or (A[i]%2==0 and A[i]%3==0) or (A[i]%2==0 and A[i]%5==0):
    i+=1
    if i==N:
      print("APPROVED")
  else:
    print("DENIED")
    break

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
count=0
for i in range(n):
    if a[i]%2==0 and (a[i]%3!=0 and a[i]%5!=0):
        count+=1
if count>0:
    print('DENIED')
else:
    print('APPROVED')

Solution (Python):
def solve():
    N = int(input())
    X = list(map(int, input().split()))
    for x in X:
        if x%2 == 0 and x%3 != 0 and x%5 != 0:
            return "DENIED"
    return "APPROVED"

print(solve())

Solution (Python):
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 and a[i] % 5 != 0) :
            flg = False
if flg :
    print("APPROVED")
else :
    print("DENIED")

Solution (Python):
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)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
app_fl = True
for Ai in [a for a in A if a % 2 == 0]:
    if Ai % 3 != 0 and Ai % 5 != 0:
        app_fl = False
        break
 

if app_fl is True:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
import sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
import math;floor,ceil=lambda x:int(math.floor(x)),lambda x:int(math.ceil(x))
from functools import reduce;gcd=lambda*x:reduce(math.gcd,x);lcm=lambda*x:reduce(lambda x,y:(x*y)//gcd(x,y),x,1)
from collections import deque
Yes=lambda b:print("Yes"if b else"No");YES=lambda b:print("YES"if b else"NO")
is_even=lambda x:True if x%2==0 else False

def is_palindrome(s):
  n=len(s);b=True
  for i in range(int(0.5*n)):
    if s[i]!=s[n-i-1]:b=False
  return b

def main():
  n=aint();a=ints();flg=0
  for num in a:
    if num%2==0 and num%3!=0 and num%5!=0:
      flg+=1
      break
  print("APPROVED"if flg==0 else"DENIED")
  
if __name__ == '__main__':
    main()

Solution (Python):
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")

Solution (Python):
import sys
N = int(input())
A = list(map(int,input().split()))
ans = "APPROVED"
for a in A:
    if(a % 2== 0):
        if(a % 3 == 0 or a % 5 == 0):
            continue
        else:
            ans = "DENIED"
            break
print(ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

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

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

Solution (Python):
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'

print(ans)

Solution (Python):
input()
A = [v for v in map(int, input().split()) if not v % 2]
for v in A:
    if v % 3 and v % 5:
        print('DENIED')
        break
else:
    print('APPROVED')

Solution (Python):
N = int(input())
A = [v for v in list(map(int, input().split())) if v % 2 == 0]
for v in A:
    if v % 3 and v % 5:
        print('DENIED')
        break
else:
    print('APPROVED')

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    num = a[i]
    if num%2:
        continue
    if num%3 == 0 or num%5==0:
        continue
    print('DENIED')
    exit()
print('APPROVED')

Solution (Python):
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')
            exit()
print('APPROVED')

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

Solution (Python):

n=int(input())
a=list(map(int,input().split()))
a_e=[int(i) for i in a if i%2==0]
a_35=[int(i) for i in a_e if i%3==0 or i%5==0]
if len(a_e)==len(a_35):print('APPROVED')
else:print('DENIED')

Solution (Python):
n = int(input())
ans = "APPROVED"
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:
            ans = "DENIED"
print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
c = 0
d = 0
for i in range(n):
    if a[i]%2==0:
        d += 1
        if a[i]%3==0 or a[i]%5==0:
            c += 1
    else:
        continue
if c == d:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):

n=int(input())
a=[]
b=[]
c=[]
a=list(map(int,input().split()))


for i in range(n):

    if a[i]%2==0:
        b.append(a[i])

    else:pass


for k in range(len(b)):

    if b[k]%3==0 or b[k]%5==0:

        c.append(b[k])

if len(b)==len(c):

    print("APPROVED")

else:
    print("DENIED")

Solution (Python):
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')
    exit()
print('APPROVED')

Solution (Python):
n=int(input())
l=list(map(int,input().split()))

flag=0
for i in range(n):
  if l[i]%2==0:
    if l[i]%3!=0 and l[i]%5!=0:
      flag=1
      break

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    nl=[]
    l=list(map(int,input().split()))
    ans='APPROVED'
    for i in l:
        if i%2==0 and i%3!=0 and i%5!=0:
            ans='DENIED'
    print(ans)
resolve()

Solution (Python):
import sys
import math

n = int(input())
a = list(map(int, input().split()))
flg = 0
b = []
for i in range(n):
    if a[i] % 2 == 0:
        b.append(a[i])
for i in range(len(b)):
    if b[i] <= 2:
        flg = 1
    elif b[i] % 3 != 0 and b[i] % 5 != 0:
        flg = 1
if flg == 0:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    nl=[]
    l=list(map(int,input().split()))
    for i in l:
        if i%2==0:
            nl.append(i)
    ans='APPROVED'
    for i in nl:
        if i%3!=0 and i%5!=0:
            ans='DENIED'
            break
    print(ans)
resolve()

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
flag = []

for i in range(0,N):
  if a[i]%2 == 0:
    if a[i]%3 == 0 or a[i]%5 == 0:
        flag.append(0)
    else:
        flag.append(1)
if sum(flag) == 0:
  print("APPROVED")
else:
  print("DENIED")

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

Solution (Python):
n = int(input())
a_list = list(map(int, input().split()))
new_list = [] 

for i in range(0, n):
    if a_list[i] % 2 == 0:
        new_list.append(a_list[i])

if all(elem % 3 == 0 or elem % 5 == 0 for elem in new_list):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N=int(input())
A=input().split()
cnt=0
for i in range(N):
    if int(A[i])%6==0 or int(A[i])%10==0:
            cnt += 1
sum=0
for i in range(N):
    if int(A[i])%2==0:
        sum += 1
if cnt==sum:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):

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


app_fl = True
for Ai in [a for a in A if a % 2 == 0]:
    if Ai % 3 != 0 and Ai % 5 != 0:
        app_fl = False
        break

if app_fl is True:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N = input()
A = list(map(str, input().split()))
B=[]
C=[]
l=[]
m=[]
n=0
i=0
for a in range(int(N)):
    if int(A[a])%2==0:
       B.append(A[a])
       i=i+1
for a in range(int(i)):
    if int(B[a])%3==0 or int(B[a])%5==0:
       n=n+1
if n==i:
   print("APPROVED")
else:
   print("DENIED")

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

approved = True

for i in range(n):
    if a[i]%2 == 0:
        if a[i]%3 != 0 and a[i]%5 != 0:
            approved = False
            break

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

Solution (Python):
N = int(input())
num = list(map(int, input().split()))
even = list(filter(lambda x: x % 2 == 0, num))
ans = "APPROVED"
for i in even:
  if i % 3 != 0 and i % 5 != 0:
    ans = "DENIED"
  
print(ans)

Solution (Python):
N =int(input())
Alist=list(map(int,input().split()))

Flag=True
for i in range(N):
    if Alist[i]%2==0:
        if Alist[i]%3==0 or Alist[i]%5==0:
            continue
        else:
            Flag=False

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

Solution (Python):

"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""


"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""

n = int(input())
A = list(map(int,input().split()))	
B = []
cnt = 0

for i in A:
    if i%2==0:
        B.append(i)
for i in B:
    if i%3==0 or i%5==0:
        cnt +=1
if cnt==len(B):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
import sys
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")
            sys.exit(0)
else:
    print("APPROVED")

Solution (Python):
n = int(input())
numList = list(map(int, input().split()))
evenCount = 0
count = 0

for num in numList:
    if num % 2 == 0:
        evenCount += 1
    if num % 2 == 0 and (num % 3 == 0 or num % 5 == 0):
        count += 1

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

Solution (Python):
N=int(input())
l=[int(x) for x in input().rstrip().split() if int(x)%2==0]
flag=1
for i in l:
  if i%3==0 or i%5==0:
    continue
  else:
    flag=0
    break
if flag==1:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
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')

Solution (Python):
N = int(input())
A = [int(k) for k in input().split()]

result = "APPROVED"

for x in A:
    if (x%2 == 0):
        if(x%3 == 0 or x%5 == 0):
            pass
        else:
            result = "DENIED"
            break

print(result)

Solution (Python):
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'
        else:
            ans = 'DENIED'
            break
    else:
        ans = 'APPROVED'
print(ans)

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = lr()
bl = all(x % 3 == 0 or x % 5 == 0 for x in A if x % 2 == 0)
print('APPROVED' if bl else 'DENIED')

Solution (Python):
import sys
input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
    N = II()
    A= LI()
    ans = 0

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

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




if __name__ == "__main__":
	main()

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a=[i for i in a if i%2==0]
for i in a:
  if i%3==0 or i%5==0:
    continue
  else:
    print("DENIED")
    exit()
print("APPROVED")

Solution (Python):
N = int(input())
arr = list(map(int,input().split()))
print('APPROVED' if all(i%2==1 or i %3==0 or i%5 == 0 for i in arr) else 'DENIED')

Solution (Python):

import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 8)

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")

Solution (Python):
approved = True
N = input()
for num in input().split():
    num = int(num)
    if (num % 2 == 0) and (num % 3 != 0 and num % 5 != 0):
        approved = False
if approved:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n,*a=map(int,open(0).read().split())
f=1
for i in a:
  if i%2==0:
    if i%3!=0 and i%5!=0:
      f=0
if f:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
N = int(input())
count=0
total_count=0

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

for x in list:
    if int(x)%2==0:
        if int(x)%3==0 or int(x)%5==0:
            total_count +=1
    else:
        total_count+=1
    count+=1

if total_count==int(N):
    print('APPROVED')

else:
    print('DENIED')

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
p = 0
for i in range(n):
    if a[i]%2 == 0:
        if a[i]%3 != 0 and a[i]%5 != 0:
            p += 1
if p > 0:
    print("DENIED")
else:
    print("APPROVED")

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
ans = [1]
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            ans.append(1)
        else:
            ans.append(-1)
if len(set(ans)) == 1:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
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')

Solution (Python):
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)

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



b=[]
for i in range(0,n):
    if a[i]%2==0:
        b.append(a[i])


c=[]
for i in range(0,len(b)):
    if b[i]%3==0 or b[i]%5==0:
        c.append(b[i])


if len(b)==len(c):
    print('APPROVED')
else:
    print('DENIED')

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

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

flag = 0
for x in a:
  if x%2==0 and (x%3 and x%5):
    flag = 1
if flag:
  print("DENIED")
else :
  print("APPROVED")

Solution (Python):

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

Solution (Python):
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)

Solution (Python):
N = int(input())
a = [int(x) for x in input().split()]
for i in range(N):
    if a[i] % 2 == 1:
        continue
    if a[i] % 3 != 0 and a[i] % 5 != 0:
        print("DENIED")
        exit()
print("APPROVED")