peterverebics/CodeNet_Python_118 huggingface dataset:
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")
N = int(input())
A = [0]*N
check = 1
A =  [int(N) for N in input().split()]
for i in range (N):
    if (A[i]%2)==0:
        if (A[i]%3)==0 or (A[i]%5)==0:
            check += 1
        else:
            check = 0
            break
if check >=1:
    print('APPROVED')
else:
    print('DENIED')
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)
n = int(input())
a_list = list(map(int, input().split()))
flag = "ok"
for i in a_list:
  #print(i)
  if i%2 == 0: 
    if i%3 != 0 and i%5 != 0:
      flag = "ng"
if flag == "ok":
  print("APPROVED") 
else:
  print("DENIED")
def main():
    n = int(input())
    a = list(map(int, input().split()))
    for i in a:
        if i % 2 == 0:
            if i % 3 != 0 and i % 5 != 0:
                print('DENIED')
                exit()
    print('APPROVED')


if __name__ == '__main__':
    main()
import sys
n = int(input()) 
l = list(map(int, input().split()))
def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False
for n in l:
  if is_even(n):
    if n % 3 == 0 or n % 5 == 0:
      pass
    else:
      print("DENIED")
      sys.exit()
print("APPROVED")
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')
N = int(input())
List_A = list(map(int, input().split()))
result = 'APPROVED'
for i in range(N):
    if List_A[i] % 2 == 0:
        if List_A[i] % 3 != 0 and List_A[i] % 5 != 0:
            result = 'DENIED'
            break
print(result)
_ = 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")
import sys
input = sys.stdin.readline

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

def cond():
    for v in a:
        if v % 2 == 0 and (v % 3 != 0 and v % 5 != 0):
            return False
    return True

if cond():
    print('APPROVED')
else:
    print('DENIED')
def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))


n = iinp()
a = lmiinps()

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

print("APPROVED")
n = int(input())
lis = list(map(int, input().split()))
flug = 0
for i in lis:
    if i % 2 == 0:
        if (i % 3 == 0) or (i % 5 == 0):
            pass
        else:
            flug = 1

if flug == 0:
    print("APPROVED")
else:
    print("DENIED")
n=int(input())
a=list(map(int,input().split()))

ans=True
for i in range(n):
    if a[i]%2==0:
        if a[i]%3==0 or a[i]%5==0:
            ans = True
        else:
            ans = False
            break
if ans:
    print("APPROVED")
else:
    print("DENIED")
n = int(input())
a = map(int, input().split())
for i in a:
    if i % 2 == 0:
        if not(i % 3 == 0 or i % 5 == 0):
            print("DENIED")
            exit(0)
print("APPROVED")
length = int(input())
nums = map(int,input().split())


for i in nums:
  if (i%2)==0:
    r = (i%3==0) or (i%5==0)
    if r:
      continue
    else:
      print("DENIED")
      exit(0)
print("APPROVED")
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")
n = int(input())
x = list(map(int, input().split()))
x = [i for i in x if i % 2 == 0]
x = [i for i in x if i % 3 != 0 and i % 5 != 0]
print("APPROVED") if len(x) == 0 else print("DENIED")
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")
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)
n = int(input())
A = list(map(int, input().split()))
cnt = 0
for a in A:
    if a%2 == 0:
        if a%3 == 0 or a%5 == 0:
            cnt = cnt
        else:
            cnt += 1
if cnt != 0:
    print("DENIED")
else:
    print("APPROVED")
import os, sys, re, math

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

answer = 'APPROVED'
for a in A:
    if a % 2 == 0:
        if not (a % 3 == 0 or a % 5 == 0):
            answer = 'DENIED'
            break

print(answer)
n = int(input())
a = list(map(int,input().split()))
ans = "DENIED"
count = 0
for i in a:
  if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
    count += 1
if count == 0:
  ans = "APPROVED"
print(ans)
n = int(input())
a = list(map(int,input().split()))
flag= 0
for i in range(n):
    if a[i]%2==0 :
        if a[i]%3==0 or  a[i]%5==0:
            continue
        else:
            flag=1

if flag==0:
    print('APPROVED')
else:
    print('DENIED')
def AorD(nums):
  for x in nums:
    if x%2==0 and x%3!=0 and x%5!=0:
      return "DENIED"
  return "APPROVED"
    

input()

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

print(AorD(nums))
# ABC 155 B
import numpy as np

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

a_even = A[A%2==0]
bool1 = a_even%3 == 0
bool2 = a_even%5 == 0
bool3 = np.sum(bool1+bool2) == len(a_even)
if bool3:
    ans = 'APPROVED'
else:
    ans = 'DENIED'
print(ans)
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:
      ans = 'APPROVED'
    else:
      print('DENIED')
      exit()
print(ans)
n  = int(input())
a_ls = list(map(int, input().split()))
yes_flg = 1
for i in range(len(a_ls)):
    if (a_ls[i] % 2 == 0) :
        if a_ls[i] % 3 != 0:
            if a_ls[i] % 5 != 0:
                yes_flg = 0
if yes_flg == 1:
    print("APPROVED")
else:
    print("DENIED")
N = int(input())
A = list(map(int,input().split()))
is_ok = 0
for i in A:
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 !=0:
      is_ok=1
      break
if is_ok == 0:
  print("APPROVED")
else:
  print("DENIED")
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")
n=int(input())
a=list(map(int,input().split()))

ad="APPROVED"
for ai in a:
    if ai%2==0:
        if ai%3!=0 and ai%5!=0:
            ad="DENIED"
            break

print(ad)
N=int(input())
A=list(map(int,input().split()))
flag=0
for a in A:
    if flag==0 and a%2==0:
        if a%3==0 or a%5==0:
            flag=0
        else:
            flag=1

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


if __name__ == '__main__':
    solve()
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")
        break
# print('input >>')
N = int(input())
As = list(map(int,(input().split())))
As_even = [e for e in As if e % 2 == 0]

for A in As_even:
    if not(A % 3 == 0 or A % 5 == 0):
        print('DENIED')
        exit()
        
# print('-----output-----')
print('APPROVED')
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')
_ = input()
a = list(map(int, input().split()))

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

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


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


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

if all((L[i]%3 == 0 or L[i]%5 == 0 for i in range(len(L)))):

    print("APPROVED")
else:
    print("DENIED")
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

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

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


if __name__ == '__main__':
    main()
f = "APPROVED"
n = int(input())
a = list(map(int, input().split()))
for i in a:
    if not (i&1) and i%3!=0 and i%5!=0:
        f = "DENIED"
print(f)
import sys
n=int(input())
a=[0]*n
a=list(map(int,input().split()))
judge=True
for i in range(0,n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
      pass
    else:
      judge=False
      print("DENIED")
      sys.exit()
if judge==True:
  print("APPROVED")
n = int(input())
num = map(int,input().split())

for i in num:
  if i % 2 == 0:
    if i%3 == 0 or i%5 == 0:
      continue
    else:
      print("DENIED")
      exit()
  else:
    continue
  
print("APPROVED")
def solve(N, As):
    bools = [a % 3 == 0 or a % 5 == 0 for a in As if a % 2 == 0]
    if len(bools) == 0:
        return "APPROVED"
    else:
        if all(bools):
            return "APPROVED"
        else:
            return "DENIED"


if __name__ == "__main__":
    N = int(input())
    As = list(map(int, input().split(" ")))
    print(solve(N, As))
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)
n=int(input())
l=map(int, input().split())
ans = "APPROVED"

for i in l:
  if i % 2 == 0:
    if i % 3 == 0:
      continue
    if i % 5 == 0:
      continue
      
    ans = 'DENIED'
    
print(ans)
n = input()
k = list(map(int, input().split()))
for i in k:
    if i%2 == 0:
        if i%3 != 0 and i%5 != 0:
            print("DENIED")
            exit()
print("APPROVED")
array = []

for i in range(2):
    val = [int(s) for s in input().split()]
    array.append(val)

A = array[1]
check = 0

for i in A:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            check += 1


if check > 0:
    print("DENIED")
else:
    print("APPROVED")
n = int(input())
a = list(map(int, input().split()))
result = "APPROVED"
for an in a:
    if an % 2 == 0:
        if an % 3 != 0 and an % 5 != 0:
            result = 'DENIED'
            break

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

flag =0
counter =0
for i in A:
    counter +=1
    if (i %2 ==1) or ((i%3)==0 or (i%5) == 0):
        pass
    else:
        flag =1

if flag== 1:
    print("DENIED")
else:
    print("APPROVED")
def check(n, da):
    for i in da:
        if i%2 == 0:
            if not(i%3 == 0 or i%5 == 0):
                return False
    return True


n = int(input())
#s = input()
#a, b, c = map(int,input().split())
da = list(map(int,input().split()))

if check(n, da):
    print('APPROVED')
else:
    print('DENIED')
#!python3

iim = lambda: map(int, input().rstrip().split())

def resolve():
    N = int(input())
    A = tuple(iim())

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

if __name__ == "__main__":
    resolve()
N = int(input())
A = list(map(int, input().split()))

is_denied = False
for ai in A:
  if ai % 2 == 0 and (ai % 3 != 0 and ai % 5 != 0):
    is_denied = True
    break

if is_denied:
  print("DENIED")
else:
  print("APPROVED")
n = int(input())
a = map(int, input().split())
for i in a:
    if (i%2==0) and ((i%3!=0) and (i%5!=0)):
        print('DENIED')
        exit()
    else:
        pass
print('APPROVED')
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())
N = int(input())
A = list(map(int, input().split()))
result = "APPROVED"
for a in A:
    if a % 2 == 0:
        if not(a % 3 == 0 or a % 5 == 0):
            result = "DENIED"
print(result)
import sys
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()
A = rl()

for a in A:
	if a % 2 == 0:
		if not (a % 3 == 0 or a % 5 == 0):
			print('DENIED')
			exit()
print('APPROVED')
import sys
n = int(input())
a = map(int,input().split())
for i in a:
    if i %2 != 0:
        continue
    else:
        if i %3 == 0 or i %5 ==0:
            continue
        else:
            print('DENIED')
            sys.exit()
print('APPROVED')
n=int(input())
a=list(map(int,input().split()))
count=0
total=0
for i in range(n):
    if a[i]%2==0:
        count+=1
        if a[i]%3==0 or a[i]%5==0:
            total+=1
if count==total:
    print("APPROVED")
else:
    print("DENIED")
N = int(input())
List = list(map(int, input().split()))
s=True
for i in List:
    if i%2==0:
        if not (i%3==0 or i%5==0):
            s=False
            break
if s:
    print('APPROVED')
else:
    print('DENIED')
N = int(input())
A = list(map(int, input().split()))
for a in A:
    if a%2==0 and not (a%3==0 or a%5==0):
        print("DENIED")
        exit()
print("APPROVED")
N = int(input())
A = map(int,input().split())

ans = "APPROVED"

for i in A:
    if i % 2 != 0:
       continue
    if (i % 3 == 0) or (i % 5 == 0):
       continue
    ans = "DENIED"
    break
print(ans)
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)
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")
# 再帰上限の追加
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")
n = int(input())
a_n = list(map(int,input().split()))

even = []
for num in a_n:
	if num%2==0:
		even.append(num)	#　偶数のみリストeven

ans = True
for num in even:
	if num%3!=0 and num%5!=0:
		ans = False
		break

if ans: print('APPROVED')
else: print('DENIED')
n = int(input())
list01 = input().split()
x = 0
for i in list01:
    if int(i) % 2 != 0:
        pass
    elif int(i) % 3 == 0:
        pass
    elif int(i) % 5 == 0:
        pass
    else:
        x += 1
        break

if x == 1:
    print('DENIED')
else:
    print('APPROVED')
import sys
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
  if A[i] % 2 != 0:
    pass
  elif A[i] % 3 != 0 and A[i] % 5 != 0:
    print("DENIED")
    sys.exit()
  else:
    pass
print("APPROVED")
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')
input = raw_input
n = int(input())

flag = True
nums = map(int, input().split(" "))
for num in nums:
    if num % 2 == 0:
        if num % 3 == 0 or num % 5 == 0:
            pass
        else:
            flag = False
            break

if flag:
    print("APPROVED")
else:
    print("DENIED")
N = int(input())
A = [int(i) for i in input().split() if int(i) % 2 == 0]

approved = True

for i in A:
    if i % 3 != 0 and i % 5 != 0:
        approved = False

if approved:
    print('APPROVED')
else:
    print('DENIED')
n=int(input())
v=[int(x) for x in input().split(" ")]
ok=1
for x in v:
    if x%2==0:
        if x%3>0 and x%5>0:
            ok=0
if ok:
    print('APPROVED')
else:
    print('DENIED')
#!/usr/bin/env python3

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

if all(i%3 == 0 or i%5 == 0 for i in A_even):
    print("APPROVED")
else:
    print("DENIED")
N = input()
A = list(map(int, input().split()))

is_even = lambda number: number % 2 == 0
is_odd = lambda number: not is_even(number)
is_dividable_by_3 = lambda number: number % 3 == 0
is_dividable_by_5 = lambda number: number % 5 == 0
is_dividable_by_3_or_5 = lambda number: is_dividable_by_3(number) or is_dividable_by_5(number)
is_approved = lambda number: is_odd(number) or (is_even(number) and is_dividable_by_3_or_5(number))

answer = 'APPROVED' if all([is_approved(Ai) for Ai in A]) else 'DENIED'

print(answer)
N = int(input())
immi = list(map(int, input().split()))
flag = 0

for el in immi:
    if el % 2 == 0:
        if not el % 3 == 0:
            if not el % 5 == 0:
                flag = 1
                break
                
if flag == 1:
    print('DENIED')
else:
    print('APPROVED')
N = int(input())
A = list(map(int, input().split()))
for i in A:
  if i % 2 == 0:
    if not ((i % 3 == 0) or (i % 5 == 0)):
      print("DENIED")
      break
else:
  print("APPROVED")
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')
N = int(input())


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

a=0
for i in A_list:
    if i%2==0 and (i%3!=0 and i%5!=0):
        a+=1

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

if ans:
    print('APPROVED')
else:
    print('DENIED')
def solve():
    N, *A = map(int, open(0).read().split())
    B = [a for a in A if a % 2 == 0]
    
    for b in B:
        if b % 3 != 0 and b % 5 != 0:
            print('DENIED')
            exit()
    print('APPROVED')


if __name__ == '__main__':
    solve()
n =  int(input())
A = list(map(int, input().split()))

l = []
for a in A:
    if a % 2 == 0:
        l.append(a)

if all([i % 3 ==0 or i % 5 ==0 for i in l]):
    print('APPROVED')
else:
    print('DENIED')
n = int(input())
a_list = list(map(int, input().split()))
flg = False
for a in a_list:
  if a % 2 == 0:
    if a % 3 > 0 and a % 5 > 0:
      flg = True
      break
  else:
    continue
if flg:
  print("DENIED")
else:
  print("APPROVED")
N = int(input())
A_list = list(map(int, input().split()))

for i in range(N):
  if A_list[i] % 2 == 0:
    if A_list[i] % 3 != 0 and A_list[i] % 5 !=0:
      print("DENIED")
      exit()

print("APPROVED")
n=input()
a=list(map(int,input().split()))
for i in a:
    if i%2==0:
        if i%3==0 or i%5==0:
            pass
        else:
            print('DENIED')
            exit(0)
print('APPROVED')
def paoers_please():
    N=input()
    A=list(map(int,input().split()))
    E=[]
    for i in A:
        if i%2==0:
            E.append(i)
    for i in E:
        if i%3!=0 and i %5!=0:
            print('DENIED') 
            exit()
    print('APPROVED')
paoers_please()
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)
import sys
input = lambda: sys.stdin.readline().rstrip() 

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

    flag = True

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

if __name__ == '__main__':
    resolve()
n = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in a:
    if i%2 ==1:
        cnt += 1
    elif i%2 == 0 and i%15 == 0:
        cnt += 1
    elif i%2 == 0 and i%5 == 0:
        cnt += 1
    elif i%2 == 0 and i%3 == 0:
        cnt += 1
if cnt == n:
    print("APPROVED")
else:
    print("DENIED")
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'
print(ans)
#!/usr/bin/env python3
import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


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

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

    print("APPROVED")


main()
N = int(input().rstrip())
l = [int(v) for v in input().rstrip().split()]
r = 'APPROVED'
for v in l:
    if v % 2 == 1:
        continue

    if v % 3 == 0 or v % 5 == 0:
        pass
    else:
        r = 'DENIED'
        break#
        
print(r)
def main():
    N = int(input())
    A = list(map(int, input().split()))

    ans = "APPROVED"
    for ai in A:
        if ai%2 == 0:
            if ai%3 > 0 and ai%5 > 0:
                ans = "DENIED"
                break
    print(ans)

    return

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

print(solve())
N = int(input())
A = list(map(int, input().split()))  # [1, 2, 3, 4] になる
B = list()
judge = 1
for a in A:
    if a%2 == 0:
        B.append(a)

for b in B:
    if b%3==0 or b%5==0:
        continue
    else:
        judge = -1

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

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

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

if count == 0:
    print('APPROVED')
else:
    print('DENIED')
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")
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")
if __name__ == '__main__':
	N = int(input())
	A = [int(a) for a in input().split()]
	c = 0
	for a in A:
		if a % 2 == 0:
			if a % 3 != 0 and a % 5 != 0:
				c = 1

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