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):
if __name__ == '__main__':
    n = int(input())
    val = input()
    a = val.split()
    a = [int(s) for s in a]
    enter = True
    for i in a:
        if i % 2 == 0:
            if not (i % 3 == 0 or i % 5 == 0):
                enter = False
    if enter:
        print('APPROVED')
    else:
        print('DENIED')

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

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

Solution (Python):
import sys

read = sys.stdin.read

N,*A = map(int, read().split())

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

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

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

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

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

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

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

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



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


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

Solution (Python):
def isEven(x):
    if x % 2 == 0:
        return True
    return False

def checkTerm(x):
    if(x % 3 == 0 or x % 5 == 0):
        return True
    return False

N = int(input())

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

checkFlag = True

for i in range(N):
    if(isEven(a[i])):
        if(checkTerm(a[i])):
            checkFlag = True
        else:
            checkFlag = False
            break

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

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

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

paper_even = [i for i in paper if i % 2 == 0 ]

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

if count == len(paper_even):
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):

import sys

n=int(raw_input())
a=map(int,raw_input().split())
b=[]
for i in range(n):
 if a[i]%2==0:
  b.append(a[i])
for i in range(len(b)):
 if not (b[i]%3==0 or b[i]%5==0):
  print 'DENIED'
  sys.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 a % 3 != 0 and a % 5 != 0:
        flag = False

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

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

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

for i in range(n):
    number = a_lst[i]

    if number%2==0:
        odd += 1
        if number%3==0 or number%5==0:
            count += 1

if odd==count:
    print('APPROVED')
else:
    print('DENIED')

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

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

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):
_ = input()
a = [int(x) for x in input().split()]
print("APPROVED" if len([aa for aa in a if aa%2==0 and aa%3!=0 and aa%5!=0])==0 else "DENIED")

Solution (Python):
N = input()
A = map(int, input().split(' '))
approved = True
for a in A:
    if not a % 2:
        if a % 3 and a % 5:
            approved = False
if approved:
    print("APPROVED")
else:
    print("DENIED")

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

f = True

for aa in a:
    if aa%2 == 0 and aa%3 != 0 and aa%5 != 0:
        f = False
        break

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

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

    bool_ = any(x for x in a if (x % 2 == 0) and not (x % 3 == 0 or x % 5 == 0))

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


if __name__ == '__main__':
    main()

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

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

A = [int(i) for i in 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:
    cnt += 1

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

Solution (Python):
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('b1.in')


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


def read_str_list():
    return input().split()


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


def read_str():
    return input()


def solve():
    N = read_int()
    A = read_int_list()
    for i in range(N):
      if A[i] % 2 == 0:
        if not (A[i] % 3 == 0 or A[i] % 5 == 0):
          return 'DENIED'
    return 'APPROVED'


def main():
    res = solve()  
    print(res)


main()

Solution (Python):

def main():
    N, *A = map(int, open(0).read().split())
    is_legal = all(i % 3 == 0 or i % 5 == 0 for i in A if i % 2 == 0)
    print("APPROVED" if is_legal else "DENIED")


if __name__ == "__main__":
    main()

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

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

APPROVED = True
for a in A:
    if a % 2 == 0:
        if not (a % 3 == 0 or a % 5 == 0):
            APPROVED = False
print("APPROVED" if APPROVED else "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")
            break
else:
    print("APPROVED")

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

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

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

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

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

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

Solution (Python):
_ = input()
line = input()

numbs = [int(v.strip()) for v in line.split()]

def get_status(numbs):
    for numb in numbs:
        if numb % 2 == 0 and (numb % 3 != 0 and numb % 5 != 0):
	        return "DENIED"
    return "APPROVED"


print(get_status(numbs))

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

Solution (Python):
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from functools import *
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
import time
import random
def Golf():
    *a,=map(int,open(0))
def S_():
    return input()
def IS():
    return input().split()
def LS():
    return [i for i in input().split()]
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def NI(n):
    return [int(input()) for i in range(n)]
def NI_(n):
    return [int(input())-1 for i in range(n)]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def LtoS(ls):
    return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'

    mp=[1]*(w+2)
    found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[1]+[mp_def[j] for j in s]+[1]
    mp+=[1]*(w+2)
    return h+2,w+2,mp,found
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)]
        rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['YES','NO']

mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()

input=lambda: sys.stdin.readline().rstrip()
 
def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True

ans=0

n=I()
a=LI()
['APPROVED','DENIED']
k=0
for i in a:
    if i%2==0 and i%3!=0 and i%5!=0:
        k=1
print(['APPROVED','DENIED'][k])

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

    S = []

    for i in range(N):
        if A[i] % 2 == 0:
            S.append(i)

    Ns = len(S)
    while True:
        for j in range(Ns):
            if A[S[j]] % 3 != 0 and A[S[j]] % 5 != 0:
                print('DENIED')
                return False
        print('APPROVED')
        break

B()

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

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

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

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

lst = []

flg = True

for i in range(len(a)):
    if a[i] % 2 == 0:
        lst.append(a[i])

for i in range(len(lst)):
    if lst[i] % 2 == 0 and lst[i] % 3 == 0 or lst[i] % 5 == 0:
        flg = True
    else:
        flg = False
        break

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

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

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

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

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):
import sys
_=input()
A=[int(i) for i in input().split()]
B=[]
for a in A:
  if a % 2 == 0:
    B.append(a)
for b in B:
  if b%3 !=0 and b%5 !=0:
    print("DENIED")
    sys.exit()
else:
  print("APPROVED")

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

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

answer = "APPROVED"
for i in range(0, len(A)):
    if A[i] % 2 == 0:
        if A[i] % 3 != 0 and A[i] % 5 != 0:
            answer = "DENIED"

print(answer)

Solution (Python):
from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 1000010
MOD = 10**9+7
spf = [i for i in range(MAXN)]
spf[0]=spf[1] = -1
def sieve():
    for i in range(2,MAXN,2):
        spf[i] = 2
    for i in range(3,int(MAXN**0.5)+1):
        if spf[i]==i:
            for j in range(i*i,MAXN,i):
                if spf[j]==j:
                    spf[j]=i
def fib(n,m):
    if n == 0:
        return [0, 1]
    else:
        a, b = fib(n // 2)
        c = ((a%m) * ((b%m) * 2 - (a%m)))%m
        d = ((a%m) * (a%m))%m + ((b)%m * (b)%m)%m
        if n % 2 == 0:
            return [c, d]
        else:
            return [d, c + d]

def charIN(x= ' '):
    return(sys.stdin.readline().strip().split(x))

def arrIN(x = ' '):
    return list(map(int,sys.stdin.readline().strip().split(x)))

def ncr(n,r):
    num=den=1
    for i in range(r):
        num = (num*(n-i))%MOD
        den = (den*(i+1))%MOD

    return (num*(pow(den,MOD-2,MOD)))%MOD

def flush():
    return sys.stdout.flush()

'''*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*'''
n = int(input())
a = arrIN()
for i in a:
    if i%2==0:
        if not (i%3==0 or i%5==0):
            print("DENIED")
            break
else:
    print('APPROVED')

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

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

Solution (Python):
N = int(input())
li = list(map(int,input().split()))
ok = True
for i in li:
    if i % 2 == 0 and (i % 3 != 0 and i % 5 != 0):
        ok = False
if ok:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
'''
Created on 2020/02/17

@author: fanta
'''

N = int(input())
nums = [int(x) for x in input().split()]
state = 0

for n in range(N):
    if (nums[n]%2 == 0):
        if ((nums[n]%3 == 0)or(nums[n]%5 == 0)):
            state += 1
    else:
        state += 1
        
if state == N:
    print("APPROVED")
else:
    print("DENIED")

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

Solution (Python):
N = int(input())
li = list(map(int,input().split()))
app = 0
for i in li:
    if i % 2 == 0 and (i % 6 == 0 or i % 10 == 0):
        pass
    elif i % 2 == 0:
        app += 1
        break
if app == 0:
    print("APPROVED")
else:
    print("DENIED")

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

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

ans = 'APPROVED'
for a in A:
    if not a % 2:
        if (not a % 3) or (not a % 5):
            pass
        else:
            ans = 'DENIED'

print(ans)

Solution (Python):
import numpy as np
import sys

n = int(input())
a = list(map(int, input().split()))
a = np.array(a)
a = a[a%2==0]

for i, j  in enumerate(a):
    if j%3 != 0 and j%5 != 0:
        print("DENIED")
        sys.exit()

print("APPROVED")

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

for b in a:
  if b % 2 == 0:
    lis.append(b)

count = 0
for c in lis:
  if c % 3 == 0 or c % 5 == 0:
    count += 1

if count == len(lis):
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
import sys
n = int(input())
a_ls = [int(i) for i in sys.stdin.readline().split() if int(i) % 2 == 0]
if all([i % 3 == 0 or i % 5 == 0 for i in a_ls]):
    print("APPROVED")
else:
    print("DENIED")

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
  if i==n-1:
    print('APPROVED')

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

ok = 0
ng = 0
even = []
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())
A=list(map(int,input().split()))
r="APPROVED"
for a in A:
  if a%2==0 and (a%3!=0 and a%5!=0):
    r="DENIED"
print(r)

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

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

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

for i in range(len(A)):
  if A[i]%2 == 0 and (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(len(A)):
  if A[i]%2 == 0 and (A[i]%3!=0 and A[i]%5!=0):
    print("DENIED")
    exit()
print("APPROVED")

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
A = LIST()

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

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
for i in range(n):
    if A[i]%2==1:
        continue
    else:
        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()))
a = filter(lambda x:(x+1)%2, a)
print('DENIED' if any((x%3)*(x%5) for x in a) else 'APPROVED')

Solution (Python):
from collections import Counter, deque, defaultdict
from functools import lru_cache

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

f=True
for i in a:
	if i&1:
		continue
	if i%3 and i%5:
		f=False
		break

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

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

ans = "APPROVED"
andflg = 1

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

print(ans)

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

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    for v in a:
        if v % 2 == 0:
            if v % 3 != 0 and v % 5 != 0:
                print("DENIED")
                exit()
    print("APPROVED")


if __name__ == '__main__':
    solve()

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

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

    print("APPROVED")


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


if __name__ == "__main__":
    main1()

Solution (Python):
input()
print(["APPROVED","DENIED"]["1"in map(lambda x:format(0x28828228,'b')[int(x)%30-2],input().split())])

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
for a in A:
    if a & 1:
        continue
    if (a % 3 != 0)and(a % 5 != 0):
        print('DENIED')
        exit(0)
print('APPROVED')

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

if __name__ == "__main__":
    main()

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

if __name__ == "__main__":
    main()

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

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

def main():
	
	
	N=int(input())
	vA=list(map(int,input().split()))
	
	vE = [a for a in vA if a%2<1]
	for a in vE:
		if a%3 and a%5:
			res = "DENIED"
			break
	else:
		res = "APPROVED"
	
	print(res)


main()

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

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

a = list(filter(lambda i: i%3 != 0 and i%5 != 0 and i%2 == 0, A))
print("APPROVED" if len(a) == 0 else "DENIED")

Solution (Python):
def I(): return int(input())
def MI(): return map(int, input().split())
def LMI(): return list(map(int, input().split()))


N = I()
A = LMI()

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

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

Solution (Python):
n=int(input())
a=list(map(int, input().split()))
temp=[]
count=0
for i in a:
    if i%2 == 0:
        temp.append(i)
for j in temp:
    if j%3==0:
        count +=1
    elif j%5==0:
        count+=1
if count== int(len(temp)):
    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())
Alist = list(map(int, input().split()))
for i in range(N):
    if Alist[i] % 2 == 0:
        if Alist[i] % 3 != 0 and Alist[i] % 5 != 0:
            print("DENIED")
            exit()
print("APPROVED")

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

Solution (Python):
input()
evens = filter(lambda x: x % 2 == 0, map(int, input().split()))
if all(map(lambda x: x % 3 == 0 or x % 5 == 0, evens)):
    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 and i % 3 and i % 5:
    ans = "DENIED"
    break
print(ans)

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

Solution (Python):
n,*a=map(int,open(0).read().split())
print("DENIED" if sum((i%3)*(i%5) for i in a if i%2==0) else "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')
        exit()
print("APPROVED")

Solution (Python):
n = int(input())
li = list(map(int,input().split()))
flag = 1
for i in range(n):
    if(li[i] % 2 == 0):
        if((li[i] % 3 == 0) or(li[i] % 5 == 0)):
            
            
            continue
        else:
            
            flag=0
    


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

Solution (Python):
a = input()
b = [int(str) for str in input().split() if int(str)%2 ==0]
c = "APPROVED"
for i in b:
    if i%3 == 0 or i%5 == 0:
        pass
    else:
        c = "DENIED"
        break

print(c)

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

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

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

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

ans = True
for a in a_list:
  if a % 2 == 0:
    if not ( ( a % 3 == 0 ) or ( a % 5 == 0 )):
      ans = False
      break
if ans:
  print( "APPROVED" )
else:
  print( "DENIED" )

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

Solution (Python):
n = int(input())
k = list(map(int, input().split())) 
app = True
for i in k:
    if (i%2 != 0):
        continue
    if not (i%3 == 0 or i%5 == 0):
        app = False
        break
if app:
    print('APPROVED')
else:
    print("DENIED")

Solution (Python):
n = int(input())
k = list(map(int, input().split())) 
app = True
for i in k:
    if (i%2 != 0):
        continue
    if not (i%3 == 0 or i%5 == 0):
        app = False
        break
if app:
    print('APPROVED')
else:
    print("DENIED")

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

ans = "APPROVED"
for i in range(n):
    if ans =="APPROVED":
        if a[i]%2 == 0:
            b = a[i]%3
            c = a[i]%5
            if b == 0 or c == 0:
                ans = "APPROVED"
            else: 
                ans = "DENIED"
    else:
        ans = "DENIED"
print(ans)