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())
al=list(map(int,input().split()))
flag=True
for i in range(n):
    v=al[i]
    if v%2==0:
        if (v%3==0) or (v%5==0):
            pass
        else:
            flag=False
            break
if flag:
    print("APPROVED")
else:
    print("DENIED")

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

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


if __name__ == '__main__':
    main()

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, A = int(input()), input()

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

flg = "True"
for i in tmp:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        flg = "False"

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

Solution (Python):
import sys
import numpy as np
n = int(input())
input = sys.stdin.readline
a = np.array(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):
def solve():
    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')


if __name__ == '__main__':
    solve()

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

if all([num % 3 == 0 or num % 5 == 0 for num in nums if num % 2 == 0]):
    print("APPROVED")
else:
    print("DENIED")

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

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

print('APPROVED')

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
for i in range (n):
    if a[i]%2==0:
        if not(a[i] % 3 == 0 or a[i] % 5 == 0):
            print("DENIED")
            break
else:
    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%5 and i%3:
            flag=False

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

Solution (Python):

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

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

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

Solution (Python):
import numpy as np

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

div2 = list(map(lambda x: (x + 1) % 2, A))
div3 = list(map(lambda x: x % 3, A))
div5 = list(map(lambda x: x % 5, A))

A = np.array(A)
div2 = np.array(div2)
div3 = np.array(div3)
div5 = np.array(div5)

Approve = A * div2 * div3 * div5

if all([Approve[i] == 0 for i in range(len(Approve))]):
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()
for j in a:
    if j % 2:
        continue
    if j % 3 == 0 or j % 5 == 0:
        continue
    print('DENIED')
    break
else:
    print('APPROVED')

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
c = 0
for i in range(N):
  if L[i] % 2 == 0:
    if L[i] % 3 == 0:
      c += 1
    elif L[i] % 5 == 0:
      c += 1
    else:
      c = 0
      break
  else:
    c += 1

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

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

print("APPROVED")

Solution (Python):
import sys

n, *A = map(int, sys.stdin.read().split())

def main():
    for a in A:
        if a % 2 == 0:
            if a % 3 == 0 or a % 5 == 0:
                continue
            else:
                return 'DENIED'
    return 'APPROVED'

if __name__ == '__main__':
    ans = main()
    print(ans)

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

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

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

for x in arr:
    if ((x % 2) == 0) and (x % 3 * x % 5):
        print("DENIED")
        break
else:
    print("APPROVED")

Solution (Python):
import sys
_ = input()
input_array = [int(e) for e in input().split()]
even = [e for e in set(input_array) if e%2==0]
divided_by_three = [e for e in even if e%3!=0]
divided_by_five = [e for e in divided_by_three if e%5!=0]
if len(divided_by_five) == 0:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
N=int(input())
W = [int(x) for x in input().split()]
for i in W:
    if i%2==0:
        if i%10==0 or i%6==0:
            pass
        else:
            print("DENIED")
            exit()
print("APPROVED")

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

Solution (Python):
n=int(input())
a=[int(x) for x in input().split()]
flag=True;
for x in a:
    if x%2==0:
        if x%3==0 or x%5==0:
            pass
        else:
            flag=False
            break
if flag==False:
    print("DENIED")
else:
    print("APPROVED")

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

alpha, beta = 1, 1

for i in A:
    if i % 2 == 0:
        alpha += 1
        if i % 3 == 0 or i % 5 == 0:
            beta += 1
if alpha == beta:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
input()
xs=[int(x) for x in input().split(' ')]
for x in xs:
  if x%2==0:
    if x%3!=0 and x%5!=0:
      print('DENIED')
      exit(0)
print('APPROVED')

Solution (Python):
import sys

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

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

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

Solution (Python):
from sys import exit

N = int(input())
A = tuple(map(int, input().split()))
for a in A:
    if not a % 2 and a % 3 and a % 5:
        print('DENIED')
        exit()
print('APPROVED')

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')
            break
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"
print(ans)

Solution (Python):
input()
A=tuple(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):
n = int(input())
l = list(map(int, input().split()))
for value in l:
    if value%2 == 0:
        if value%3 != 0 and value%5 != 0:
            print ("DENIED")
            exit (0)
print ("APPROVED")

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

Solution (Python):
N = int(input())
A = list(map(int , input().split()))
ans = []
bns = []
for i in A:
    if i % 2 == 0:
        ans.append(i)
for i in ans:
    if i % 3 == 0 or i % 5 == 0:
        bns.append(i)
if len(ans) == len(bns):
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
n = int(input())
data = [i for i in [int(i) for i in input().split()] if i % 2 == 0]
flag = 'APPROVED'
for i in data:
  if i % 3 != 0 and i % 5 != 0:
    flag = 'DENIED'
    break
print(flag)

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)*(a[i]%5) != 0:
      print("DENIED")
      quit()
print("APPROVED")

Solution (Python):



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

Solution (Python):



s = [input() for i in range(2)]
N = int(s[0])
As = sorted(list(s[1].split()))


pp = "APPROVED"

for i in range(0,N):
	if (int(As[i]) % 2) == 0 :
		if (As[i] == 2)or(As[i] == 4):
			pp = "DENIED"
			break			
		elif (int(As[i]) % 3)*(int(As[i]) % 5) == 0 :
			continue
		else:
			pp = "DENIED"
			break
		

print(pp)

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

Solution (Python):
import sys

N = sys.stdin.readline().strip()
A = [int(x) for x in sys.stdin.readline().strip().split(' ')]

for a in A:
    if a % 2 != 0:
       continue 
    if a % 3 != 0 and a % 5 != 0:
        print "DENIED"
        break
else:
    print "APPROVED"

Solution (Python):
import unittest


class TestB(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think([6, 7, 9, 10, 31]), 'APPROVED')

    def test_2(self):
        self.assertEqual(think([28, 27, 24]), 'DENIED')


def solve():
    a = read()
    result = think(a)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return read_type(int, n, sep=' ')


def read_float(n):
    return read_type(float, n, sep=' ')


def read_type(t, n, sep):
    return list(map(lambda x: t(x), read_line().split(sep)))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a):
    approved = True
    for e in a:
        if e % 2 == 0:
            if e % 3 == 0 or e % 5 == 0:
                continue
            else:
                approved = False
                break
        else:
            continue
    return 'APPROVED' if approved else 'DENIED'


def write(result):
    print(result)


if __name__ == '__main__':
    
    solve()

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

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

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

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

flg=0

for i in A:
  if i%2==0:
    if (i%3!=0) and (i%5!=0):
      flg=1
      
if(flg==1):
  print("DENIED")
else:
  print("APPROVED")

Solution (Python):
m = int(input())
n = list(map(int,input().split()))
f=0
for i in n:
    if i%2==0 and not (i%3==0 or i%5==0):
        f=1

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

Solution (Python):
import sys
import numpy as np

input = sys.stdin.readline

N = int(input())
A = np.fromstring(input(), dtype=int, sep=' ')
A = A[A % 2 == 0]
if np.all((A % 3 == 0) | (A % 5 == 0)):
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
import sys

input = sys.stdin.readline

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):
n = int(input())
arr = list(map(int, input().split()))

judgement = True

for i in arr:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            continue
        else:
            print("DENIED")
            judgement = False
            break

if judgement:
    print("APPROVED")

Solution (Python):
N=int(input())
As=list(map(int,input().split()))
As=[i for i in As if i%2==0]
def check(i):
    if i%3==0 or i%5==0:
        return True
    else:
        return False
new_As=[i for i in As if check(i)]
if len(As)==len(new_As):
    print("APPROVED")
else:
    print("DENIED")

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

Solution (Python):
from sys import stdin

def main():

    input = stdin.readline

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

    judge = "APPROVED"
    for n in N:
        if(n%2==0) and (n%5!=0) and (n%3!=0):
            print("DENIED")
            break
    else:
        print(judge)


if __name__ == "__main__":
    main()

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

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

for a in A:
    if a % 2: continue 
    if not a % 3: continue 
    if not a % 5: continue
    print('DENIED')
    sys.exit()
print('APPROVED')

Solution (Python):
import sys

def result():


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

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


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

    print('APPROVED')
    return 


result()

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

Solution (Python):
n,*a=map(int,open(0).read().split())

for i in a:
  if i%2==0:
    if not (i%3==0 or i%5==0):
      print("DENIED")
      exit()
print("APPROVED")

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

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

count0, count1 = 0, 0
for i in range(n):
    if a[i]%2  == 0:
        count0 += 1
        if a[i]%3 == 0 or a[i]%5 == 0:
            count1 += 1
            
if count0 == count1:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
N = int(input())
p = 'APPROVED'

for i in map(int, input().split()):
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      continue
    else:
      p = 'DENIED'
print(p)

Solution (Python):
N = int(input())
S = input()
A = S.split(' ')

count = 0
for i in A:
  i = int(i)
  if i%2==0:
    if not (i%3==0 or i%5==0):
      count += 1
if count ==0:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines  

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

Solution (Python):
_,a=open(0);print('ADPEPNRIOEVDE D'[any(~a%2*a%3*a%5for a in map(int,a.split()))::2])

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

Solution (Python):
N = int(input())
Ai = input()
Ai = Ai.split(' ')
ans = 'APPROVED'
for moji in Ai:
    moji = int(moji)
    if moji % 2 != 0:
        pass
    else:
        if (moji % 3 == 0) or (moji % 5 == 0):
            pass
        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:
        if a[i]%3 == 0 or a[i]%5 == 0:
            count += 1
        else:
            count -=200
print("APPROVED" if count >=0  else "DENIED")

Solution (Python):



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

result = "APPROVED"

for a in aList :
  if a % 2 == 0 :
    if a % 6 != 0 and a % 10 != 0 :
      result = "DENIED"
      break

print(result)

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())
A = map(int, input().split())

if all(map(lambda x: x % 2 == 1 or x % 3 == 0 or x % 5 == 0, A)):
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
yes="APPROVED"
no="DENIED"
N=int(input())
a=list(map(int,input().split()))
flag=True
for i in a:
    if i%2==1:
        continue
    if not(i%5==0 or i%3==0):
        
        flag=False
        break
if flag:
    print(yes)
else:
    print(no)

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

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

Solution (Python):
input()
nums = [int(n_str) for n_str in input().split(' ')]

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

print("APPROVED")

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

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

Solution (Python):
import sys
n = int(input())
l = list(map(int, input().split(" ")))
for i in l:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 ==0:
            pass
        else:
            print("DENIED")
            sys.exit()

print("APPROVED")

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
ans = True
for a in A:
  if a%2==0:
    if a%3!=0 and a%5!=0:
      ans = False
if ans:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
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
if x==0:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
r = 'APPROVED'
n = input()
for x in [int(a) for a in input().split()]:
    if x%2==0:
        if x%3!=0 and x%5!=0:
            r = 'DENIED'
            break
print(r)

Solution (Python):
input()
for a in map(int,input().split()):
  if a&1: continue
  if a%3 and a%5:
    print("DENIED")
    exit()
print("APPROVED")

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

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in a:
    if i%2 ==1:
        cnt += 1
    elif i%2 == 0 and i%15 == 0:
        cnt += 1
    elif i%2 == 0 and i%5 == 0:
        cnt += 1
    elif i%2 == 0 and i%3 == 0:
        cnt += 1
if cnt == n:
    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:
            pass
        else:
            ans = "DENIED"
            break
    else:
        pass
print(ans)

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

flag = 0

for a in A:
  if a%2 == 0:
    if not (a%3 == 0 or a%5 == 0):
      flag = 1

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def solve():
    n = II()
    a = LI()
    for i in a:
        if i & 1:
            continue
        if i % 3 == 0 or i % 5 == 0:
            continue
        else:
            print("DENIED")
            return
    print("APPROVED")
    return



if __name__ == '__main__':
    solve()

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

result = "APPROVED"
for i in numbers:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            result = "DENIED"
            break
            
print(result)

Solution (Python):

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

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

Solution (Python):
def AorD(nums):
  for x in nums:
    if x%2==0 and x%3!=0 and x%5!=0:
      return "DENIED"
  return "APPROVED"
    

input()

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

print(AorD(nums))

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]%6!=0 and A[i]%10!=0:
            cnt=1
            print('DENIED')
            break
    else:
        pass
if cnt==0:
    print('APPROVED')

Solution (Python):
n = int(input())
list = [int(x) for x in input().split(" ")]
result = 'APPROVED'
for i in range(len(list)):
    if list[i]%2 == 0:
        if list[i]%3 != 0 and list[i]%5 != 0:
            result = 'DENIED'
            break
print(result)

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

s = "APPROVED"
for i in AL:
  if i%2 == 0 and i%3 != 0 and i%5 != 0:
    s = "DENIED"
print(s)

Solution (Python):
n = int(input())
A = [int(x) for x in input().split()]
flag = True
for i in range(0, n) :
	if A[i] % 2 != 0 :
		continue
	elif A[i] % 2 == 0 and (A[i]%3 == 0 or A[i]%5 == 0) :
		continue
	else :
		flag = False
		break
if flag :
	print ("APPROVED")
else :
	print ("DENIED")

Solution (Python):
import numpy as np
N = int(input())
A = list(map(int, input().split()))

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

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

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

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

a = [i for i in list(map(int, input().split())) if i%2 == 0]

ans = [i for i in a if (i%3!=0 and i%5!=0)]

if len(ans) > 0:
    print("DENIED")
else:
    print("APPROVED")

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

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

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

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 or a[i] %5 == 0:
            pass
        else:
            print('DENIED')
            sys.exit()
    else:
        pass

print('APPROVED')

Solution (Python):
N = input().split(' ')

A = input().split(' ')

val = True

for i in A:
  num = int(i)
  if num % 2 ==0:
    if num % 3 ==0 or num % 5 == 0:
      continue
    else:
      val = False
      break
      
if val == True:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):

N = input().split(' ')

A = input().split(' ')


val = True
for i in A:
  num = int(i)
  
  if num % 2 == 0:
    if num % 3 == 0 or num % 5 == 0:
      continue
    else:
      val = False
      break

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

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

N = int(readline())
A = list(map(int, readline().split()))
print('APPROVED' if all([x%3 == 0 or x%5 == 0 for x in A if x%2 == 0]) else 'DENIED')

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

Solution (Python):
n=int(input())
lis=list(map(int,input().split()))
f=True
for x in lis:
    if x%2!=0:
        continue
    else:
        if x%3!=0 and x%5!=0:
            f=False
            break
if f==True:print("APPROVED")
else:print("DENIED")

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
flg = True
for a in A:
  if a % 2 == 0:
    if a % 3 != 0 and a % 5 != 0:
      flg = False
      break
if flg:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
input()
o = True
for i in map(int, input().split()):
  if i % 2 == 0:
  	if not i % 3 == 0 and not i % 5 == 0:
  		o = False

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

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
ans = [i for i in A if i%2==0] 
AA = [i for i in ans if i%3==0 or i%5==0]     
if len(AA) == len(ans):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
flg = True
for a in A:
  if a % 2 == 0:
    if a % 3 != 0 and a % 5 != 0:
      flg = False
      break
if flg:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
n = int(input())
*a, = 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)

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 and A[i] %5 != 0:
			flag = 1

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

Solution (Python):
n = int(input())
a = [int(i) for i in input().split(" ")]

odds = [i for i in a if i % 2 == 0]
result = "APPROVED"
for i in odds:
  if i % 3 != 0 and i % 5 != 0:
    result = "DENIED"
    break
print(result)

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 or i%5==0:
            pass
        else:
            flag = False
    else:
        flag == False
if flag==True:
    print("APPROVED")
if flag == False:
    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 or A[i] % 5 == 0:
      None
    else:
      print("DENIED")
      sys.exit()
print("APPROVED")

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

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