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

import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from functools import lru_cache
from heapq import heappop,heappush
import time
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(2000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s


n=int(input())

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

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

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

Solution (Python):
a, *D, = [list(map(int, s.split())) for s in open(0)] 
D = D[0]
flag = 0
for d in D:
    if d % 2 == 0:
        if d % 3 == 0 or d % 5 == 0:
            pass
        else:
            flag +=1 
            break
if not 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]%6==0 or a[i]%10==0 or a[i]%2==1:
        flag=True
    else:
        flag=False
        print('DENIED')
        break
if flag:
    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):
            continue
        else:
            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:
        if a%3==0 or a%5==0:
            continue
        else:
            print("DENIED")
            exit()
print("APPROVED")

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

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

f()

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

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

print("APPROVED")

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

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

Solution (Python):

MOD = 10 ** 9 + 7
INFI = 10**10

import math

import itertools



import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default






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

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



    print(ans)

if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
a = IL()

cnt = 0
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()))

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

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

Solution (Python):
N, *A = map(int, open(0).read().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):
import sys

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

a_even = list(filter(lambda x: x % 2 == 0, a_list))
for a in a_even:
    if a % 3 != 0 and a % 5 != 0:
        print('DENIED')
        sys.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 and a[i]%5:
            flag=False

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

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

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

print(ans)

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

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

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
for i in l:
    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()))

for a in A:
    if a&1: continue
    if a%3==0: continue
    if a%5==0: continue
    print("DENIED")
    exit()
print("APPROVED")

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

Solution (Python):

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

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

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

AP = True
for aa in a:
    if aa % 2 == 0:
        if aa % 3 != 0 and aa % 5 != 0:
            AP = False

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

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

is_DENIED = False

for a in A:
    if a % 2 == 0:
        if not (a % 3 == 0 or a % 5 == 0):
            is_DENIED = True
            break

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

Solution (Python):
import sys

stdin = sys.stdin

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

n = ni()
a = nl()
a = filter(lambda x:x%2==0, a)
print('APPROVED' if all((x%3)*(x%5)==0 for x in a) else 'DENIED')

Solution (Python):
from sys import setrecursionlimit as srl; srl(10**7)
rr = lambda: int(raw_input())
rrm = lambda: map(int, raw_input().split())

YES,NO = "APPROVED","DENIED"
def solve(N, A):
    for x in A:
        if x % 2 == 0:
            if x % 3 and x % 5:
                return NO
    return YES

    
print solve(int(rr()), rrm())

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

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

ans = "APPROVED"
for i in a:
    if i%2==0:
        if i%3==0:
            pass
        elif i%5==0:
            pass
        else:
            ans = "DENIED"
print(ans)

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

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

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

ok = True

for i in l:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            pass
        else:
            ok = False

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

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

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

cond = 1
for i in range(N):
	if A[i] % 2 == 0:
		if not((A[i] % 3 == 0) or (A[i] % 5== 0)):
			cond = 0
			break

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

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 or i%5==0:
            continue
        else:
            print("DENIED")
            quit()
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 and i % 5 != 0:
            print("DENIED")
            sys.exit()
print("APPROVED")

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

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
ans=True
for i in a:
    if i%2==0:
        if i%3==0:
            pass
        elif i%5==0:
            pass
        else:
            ans=False
if ans==True:
    print('APPROVED')
else:
    print('DENIED')

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

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

Solution (Python):
N=int(input())
la=list(map(int,input().split()))
for i in la:
    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()))
ok = True
for x in a:
	if x % 2 == 0 and x % 3 != 0 and x % 5 != 0:
		ok = False
if ok:
	print("APPROVED")
else:
	print("DENIED")

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 e in a:
    if e%2:continue
    if e%3 and e%5:
        print('DENIED')
        exit()
else:
    print('APPROVED')

Solution (Python):
def main():
    N = int(input())
    AN = map(int, input().split())

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

    print(ans)


main()

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

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

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

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

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

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

B = [int(x) for x in A if x % 2 == 0]

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

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

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

Solution (Python):

import sys
sys.setrecursionlimit(1000000)

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

print("APPROVED")

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

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

flag = 1
for i in range(N):
    if A[i] %2 == 1:
        continue
    elif A[i]%3 == 0 :
        continue
    elif A[i]%5== 0:
        continue
    else:
        flag = 0

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

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

bl = True
for e in a:
    if e % 2 == 0:
        if e % 3 == 0 or e % 5 == 0:
            continue

        bl = False
        break

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

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


if __name__ == '__main__':
    main()

Solution (Python):
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
def gcd(a,b):return fractions.gcd(a,b) 
def lcm(a,b):return (a*b) // fractions.gcd(a,b) 
def iin(): return int(input()) 
def ifn(): return float(input()) 
def isn(): return input().split() 
def imn(): return map(int, input().split()) 
def fmn(): return map(float, input().split()) 
def iln(): return list(map(int, input().split())) 
def iln_s(): return sorted(iln()) 
def iln_r(): return sorted(iln(), reverse=True) 
def fln(): return list(map(float, input().split())) 
def join(l, s=''): return s.join(l) 
def perm(l, n): return itertools.permutations(l, n) 
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) 
def comb(l, n): return itertools.combinations(l, n) 
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) 
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 
def m_add(a,b): return (a+b) % MOD

N = iin()
A = iln()

isOK = True
for i in range(N):
    if A[i] % 2 == 0:
        if not (A[i] % 3 == 0 or A[i] % 5 ==0):
            isOK = False
            break
if isOK:
    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 (a % 3 == 0) or (a % 5 == 0):
            continue
        else:
            print ('DENIED')
            exit()
    else:
        continue

print ('APPROVED')

Solution (Python):
n=int(input())
A=[int(i) for i in input().split()]
Chk=True
for a in A:
    if a%2==0:
        if a%3!=0 and a%5!=0:
            Chk=False
if Chk:
    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
    ans = 'DENIED'
    break

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
f=True
for i in a:
    if i%2==0:
        if not(i%3==0 or i%5==0):
            f=False
            break
print("APPROVED" if f else "DENIED")

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

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

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

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

for i in a:
    if i % 2 == 1:
        continue
    if i % 3 == 0 or i % 5 == 0:
        continue
    print('DENIED')
    exit()

print('APPROVED')

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
    else:
        print('DENIED')
        exit()

print('APPROVED')

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

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

Solution (Python):
from sys import stdin
n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
for i in li:
    if i % 2 == 0:
        if i%3 != 0 and i%5 != 0:
            print("DENIED")
            exit()
print("APPROVED")

Solution (Python):
from bisect import *
from collections import *
from fractions import gcd
from math import factorial
from itertools import *
from heapq import *
import copy




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

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

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

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

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

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

ans = "APPROVED"
for i in a:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            pass
        else:
            ans = "DENIED"
    else:
        pass
print(ans)

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

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

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] % 5 == 0 or a[i] % 3 == 0:
            pass
        else:
            flag = False
if flag:
    print("APPROVED")
else:
    print("DENIED")

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

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    n = ri()
    la = rli()
    for a in la:
        if a % 2 == 0:
            if a % 3 != 0 and a % 5 != 0:
                print("DENIED")
                return
    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 = int(input())
A = list(map(int, input().split()))

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

Solution (Python):
import sys, math
def input():
    return sys.stdin.readline()[:-1]
from itertools import permutations, combinations
from collections import defaultdict, Counter
from math import factorial
from bisect import bisect_left 


sys.setrecursionlimit(10**7)
N = int(input())
A = list(map(int, input().split()))

flg = True
for a in A:
    if a%2==0:
        if a%3==0 or a%5==0:
            continue
        else:
            flg = False
            break

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

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

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

Solution (Python):
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))



N = I()
A = LI()

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()))
ok = True
for i in a:
    if i%2==0 and (i%3!=0 and i%5!=0):
        ok = False
if ok==True:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
_ = input()
AS = list(map(int,input().split()))

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

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

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 or A[i] % 5 == 0:
            pass
        else:
            ans = 'DENIED'

print(ans)

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

Solution (Python):
n = int(input())
a = [int(i) for i in input().split() if int(i) % 2 == 0]
f = 1
for i in range(len(a)):
    if a[i] % 3 == 0 or a[i] % 5 == 0:
        f *= 1
    else:
        f *= 0
if f == 0:
    print("DENIED")
else:
    print("APPROVED")

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

if __name__ == '__main__':
    main()

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

Solution (Python):
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)


def get_nums_l():
    return [ int(s) for s in input().split(" ")]


def get_nums_n(n):
    return [ int(input()) for _ in range(n)]


def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

n,*aaa = get_all_int()

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

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

for num in a:
    if num & 1: continue
    if num % 3 != 0 and num % 5 != 0:
        print "DENIED"
        exit()

print "APPROVED"

Solution (Python):

import sys
input = sys.stdin.readline

n = int(input())
a = [int(item) for item in input().split()]

ok = True
for item in a:
    if item % 2 == 0:
        if item % 3 != 0 and item % 5 != 0:
            ok = False
if ok:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
def main():
    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:
                continue
            else:
                flag = False

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


if __name__ == "__main__":
    main()

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

Yes = "APPROVED"
No = "DENIED"

f = Yes
for i in A:
  if i % 2 == 1: continue
  if i % 3 != 0 and i % 5 != 0:
    f = No

print(f)

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


if __name__ == '__main__':
    main()

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

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