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

ans=0
for a in A:
    if a%2==0:
        if a%3!=0 and a%5!=0:
            ans+=1

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

Solution (Python):



import sys
readline = sys.stdin.readline
read = sys.stdin.read





n,*a = [int(i) for i in read().split()]

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

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

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

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]
if all(a % 3 == 0 or a % 5 == 0 for a in A if a % 2 == 0):
    print('APPROVED')
else:
    print('DENIED')

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

evens = [a for a in A if a % 2 == 0]

for e in evens:
    if e % 3 != 0 and e % 5 != 0:
        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")
            exit()

print("APPROVED")

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

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

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 and a[i]%5:
            print("DENIED")
            exit()
print('APPROVED')

Solution (Python):
def examA():
    N = LI()
    N.sort()
    if N[0]==N[1] and N[0]!=N[2]:
        print("Yes")
    elif N[1]==N[2] and N[0]!=N[2]:
        print("Yes")
    else:
        print("No")
    return

def examB():
    N = I()
    A = LI()
    for a in A:
        if a%2==0:
            if a%3!=0 and a%5!=0:
                print("DENIED")
                return
    print("APPROVED")
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math,random
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examB()

"""

"""

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

print(ret)

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

approve=True

for a in A:
    if a%2==1:
        continue
    if a%3!=0 and a%5!=0:
        approve=False

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

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""


n = onem()

a = l()

a.sort()

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

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

Solution (Python):
import sys,collections

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  l=LI()

  f=False
  for x in l:
    if x%2==0:
      if x%3!=0 and x%5!=0:
        f=True

  if f:
    return 'DENIED'
  return 'APPROVED'


print(main())

Solution (Python):

import sys
INF = float("inf")


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

    flag = True
    for a in A:
        if a % 2 == 1:
            continue
        if not (a % 3 == 0 or a % 5 == 0):
            flag = False
            break
    if flag:
        print("APPROVED")
    else:
        print("DENIED")


if __name__ == '__main__':
    main()

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)
MOD = 10**9+7
 

def input():
    return sys.stdin.readline()[:-1]
 

def main():
    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")
 
 
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):
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()))
flg = 1
for i in range(N):
  if A[i] % 2 == 0:
    if A[i] % 3 != 0 and A[i] % 5 != 0:
      flg = 0
if flg == 1:
  print("APPROVED")
else:
  print("DENIED")

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

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

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

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

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

flg = 0

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

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



if __name__ == '__main__':
    main()

Solution (Python):
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 = map(int, input().split())
for i in A:
    if i % 2 == 0:
        if i % 5 != 0 and i % 3 != 0:
            print('DENIED')
            break
else:
    print('APPROVED')

Solution (Python):
import sys
range = xrange
input = raw_input

n = int(input())

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

B = [a for a in A if a&1 == 0]

if B == [b for b in B if b%3 == 0 or b%5 == 0]:
    print 'APPROVED'
else:
    print 'DENIED'

Solution (Python):

N = int(input())

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

flag = "APPROVED"

for i in range(N):

    if A[i] % 2 == 0 and A[i] % 3 != 0 and A[i] % 5 != 0:
        flag = "DENIED"
        break

print (flag)

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A):
    for a in A:
        if a % 2 == 0:
            if a % 3 != 0 and a % 5 != 0:
                return 'DENIED'
    return 'APPROVED'


def main():
    N = read_int()
    A = read_int_n()
    print(slv(N, A))


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):
def main():
    n = int(input())
    *a, = map(int, input().split())

    for x in a:
        if x % 2 == 1:
            continue

        if x % 3 == 0 or x % 5 == 0:
            continue

        print('DENIED')
        return

    print('APPROVED')


if __name__ == '__main__':
    main()

Solution (Python):



def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    

    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(0)
    print('APPROVED')


if __name__ == '__main__':
    main()

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")
                return
    print("APPROVED")


main()

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    A = LI()
    wari = True
    for ix, a in enumerate(A):
        if a % 2 == 0:
            if a % 3 == 0 or a % 5 == 0:
                continue
            else:
                wari = False
                break
    if wari:
        print("APPROVED")
    else:
        print("DENIED")
main()

Solution (Python):
n = int(input())
nums = list(map(int, input().split()))
ng = False
for i in nums:
    if i % 2 != 0:continue
    if i % 3 != 0 and i % 5 != 0:ng = True

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

Solution (Python):

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

flag = True

for a in A:
    if a%2 == 0:
        if a%3 == 0 or a%5 == 0:
            None
        else:
            flag = False

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

Solution (Python):
def main():

    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):
            return "DENIED"
    return "APPROVED"


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

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

print('APPROVED' if all(a%2==1 or (a%3==0 or a%5==0) for a in A) else 'DENIED')

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

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

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

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n = ni()
a = na()
for ai in a:
    if ai % 2 == 0 and ai % 3 != 0 and ai % 5 != 0:
        print("DENIED")
        quit()
print("APPROVED")

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


def check(A):
    for a in A:
        if a % 2 == 1:
            continue
        if a % 3 == 0 or a % 5 == 0:
            continue
        return False
    return True


if check(A):
    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 and i%5!=0:
   print('DENIED')
   exit()
print('APPROVED')

Solution (Python):


from collections import deque, defaultdict
import itertools as ite
import sys
import math
from decimal import *

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N = input()
A = map(int, raw_input().split())
for num in A:
    if num % 2 == 0:
        if num % 3 != 0 and num % 5 != 0:
            print "DENIED"
            exit()
print "APPROVED"

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

flag = True

for a in arr:
    if a % 2 == 0:
        if a%3 == 0 or a%5 ==0:
            continue
        else:
            flag = False
    else:
        continue

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

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    vn = vk = vn_k = 1
    for i in range(1, n+1):
        vn = vn * i % modp
        if i == k:
            vk = vn
        if i == n-k:
            vn_k = vn
    return vn * get_inv(vk, modp) * get_inv(vn_k, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp



def main():
    N=ii()
    A=lmis()
    print('APPROVED' if all(a%3==0 or a%5==0 for a in A if a%2==0) else 'DENIED')

main()

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

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

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

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

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

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

out='APPROVED'

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

Solution (Python):

N = int(input())
*A, = map(int, input().split())
for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            pass
        else:
            print("DENIED")
            exit()
print("APPROVED")

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

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

flag = True

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

if flag:
    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:
            pass
        elif i%5 == 0:
            pass
        else:
            print("DENIED")
            exit()
print("APPROVED")

Solution (Python):
n = int(input())
a = [int(i) for i in 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):
N=int(input())
A=list(map(int,input().split()))
r=1
for a in A:
    if a%2==0 and a%3!=0 and a%5!=0:
        r=0
print(['DENIED','APPROVED'][r])

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 or a[i] % 5 == 0:
            continue
        else:
            print("DENIED")
            exit()
print("APPROVED")

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):
import sys, bisect, math, itertools, string, queue, copy


from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush

sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input()) 
def inpm(): return map(int,input().split()) 
def inpl(): return list(map(int, input().split())) 
def inpls(): return list(input().split())  
def inplm(n): return list(int(input()) for _ in range(n)) 
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return sorted([list(map(int, input().split())) for _ in range(n)]) 
def graph():
    n=inp()
    g=[[] for _ in range(n)]
    for i in range(n):
        a = inp()
        a -= 1
        g[i].append(a)
        g[a].append(i)
    return n,g

def main():
    n = inp()
    a = inpl()
    for i in range(n):
        if a[i]%2 == 0:
            if a[i]%3==0 or a[i]%5==0:
                continue
            print('DENIED')
            return
    print('APPROVED')
    
if __name__ == "__main__":
    main()

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

print('APPROVED')

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

flag=0
for a in A:
    if a%2==0:
        b=a//2
        if b%3==0 or b%5==0:
            flag+=0
        else:
            flag+=1
    else:
        flag+=0
print('DENIED' if flag else 'APPROVED')

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) or (a % 5 == 0):
            pass
        else:
            print("DENIED")
            break
else:
    print("APPROVED")

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

N = int(input())
A = list(map(int, input().split()))
ok = True
for a in A:
    if a%2 == 0:
        if a%5 != 0 and a%3 != 0:
            ok = False
print("APPROVED" if ok 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 or A[i] % 5 == 0:
            continue
        else:
            flag = False
            break
    else:
        continue
if flag:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n=int(input())
A=list(map(int,input().split()))
for ai in A:
  if ai % 2 == 0:
    if not(ai % 3 == 0 or ai % 5 == 0):
      print("DENIED")
      exit()
print("APPROVED")

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    A=LI()
    for a in A:
        if a%2==0 and not (a%3==0 or a%5==0):
            print("DENIED")
            return
    print("APPROVED")
if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
A=list(map(int, input().split()))
ans="APPROVED"
for i in range(N):
    a=A[i]
    if a%2==0:
        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=[a for a in A if a%2==0]
B=[a for a in A if a%3==0 or a%5==0]

if len(A)==len(B):
    print("APPROVED")
else:
    print("DENIED")

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

Solution (Python):
N = int(input())
A =[int(i) for i in 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)
            exit()
print(ans)

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

ok = True
for a in As:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            pass
        else:
            ok = False
if ok:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
import sys
import numpy as np

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

N = ir()
A = np.array(lr())
A = A[A%2==0].tolist()
bool = True
for a in A:
    if a%3 != 0 and a%5 != 0:
        bool = False

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

Solution (Python):
input()
print "APPROVED" if all(x%2!=0 or x%3==0 or x%5==0 for x in map(int, raw_input().split())) else "DENIED"

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

ans = 'APPROVED'
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            continue
        else:
            ans = 'DENIED'
            break

print(ans)

Solution (Python):
N = int(input())
d = [int(c) for c in input().split()]
for c in d:
  if c%2==0:
    if c%3!=0 and c%5!=0:
      print('DENIED')
      break
else:
  print('APPROVED')

Solution (Python):
import sys
input = sys.stdin.readline
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(0)
print("APPROVED")

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
for a in A:
    if a % 2 == 1:
        continue

    if a % 3 == 0:
        continue

    if a % 5 == 0:
        continue

    print('DENIED')
    break
else:
    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 or i % 5 == 0:
            continue
        else:
            print("DENIED")
            exit()
print("APPROVED")

Solution (Python):
import sys
def fastio():
    from io import StringIO
    from atexit import register
    global input
    sys.stdin = StringIO(sys.stdin.read())
    input = lambda : sys.stdin.readline().rstrip('\r\n')
    sys.stdout = StringIO()
    register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var, sep = ' ', end = '\n'):
    print(*var, file=sys.stderr, end = end, sep = sep)

INF = 10**20
MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))

from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br

n, = I()
a = I()
ans = 'APPROVED'
for i in range(n):
    if (not a[i] % 2) and a[i] % 3 and a[i] % 5:
        ans = 'DENIED'
        break
print(ans)

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

Solution (Python):
import sys
import math
import fractions
import bisect
import queue
import heapq
from collections import deque
sys.setrecursionlimit(4100000)

MOD = int(1e9+7)
PI = 3.14159265358979323846264338327950288
INF = 1e18

'''
1行のint=====================================
N, K = map(int, input().split())

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

H, W = map(int, input().split())

L, R = map(int, input().split())

1行のstring=================================
S, T = input().split()

1行の整数配列================================
P = list(map(int,input().split()))

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

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

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

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

改行あり整数==================================
X = []
Y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    X.append(x1)
    Y.append(y1)

A = []
B = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    A.append(x1)
    B.append(y1)

Pair = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    Pair.append((x1, y1))


N行M列の初期化====================================
dp = [[VAL] * RETU for i in range(GYO)]

'''

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")
        sys.exit()
   
print("APPROVED")

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

Solution (Python):
N, *A = map(int, open(0).read().split())
K = ["DENIED", "APPROVED"]
print(K[all(a % 3 == 0 or a % 5 == 0 for a in A if a & 1 == 0)])

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 or i % 5 == 0:
                continue
            else:
                return 'DENIED'
    return 'APPROVED'



print(main())

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

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

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

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

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

Solution (Python):
N = int(input())
A = [int(i) for i in 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()))
print("APPROVED" if all([a%2 == 1 or a%3 == 0 or a%5 == 0 for a in A]) else "DENIED ")

Solution (Python):
N = int(input())
A = [int(_) for _ in input().split()]
ans = 'APPROVED'
for a in A:
    if a % 2 == 0:
        if a % 3 and a % 5:
            ans = 'DENIED'
print(ans)