import sys

from collections import *

import heapq

import math

import bisect

from itertools import permutations,accumulate,combinations,product

from fractions import gcd

def input():

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

mod=pow(10,9)+7



n=int(eval(input()))

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

for i in range(n):

    if a[i]%2==0:

        if a[i]%3==0 or a[i]%5==0:

            pass

        else:

            print("DENIED")

            break

else:

    print("APPROVED")
n=int(eval(input()))

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



s=1

for i in range(n):

    s=s*a[i]



# sが奇数なら

if s%2==1:

    print("APPROVED")

    exit()



p=[]

for i in range(n):

    p.append(1)



z=0

for i in range(n):

    if a[i]%2==1:

        p[i]=0

    else:

        if a[i]%6==0:

            p[i]=0

        elif a[i]%10==0:

            p[i]=0

    z=z+p[i]



if z==0:

    print("APPROVED")

else:

    print("DENIED")
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations, accumulate, combinations, product
from fractions import gcd


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


mod = pow(10, 9) + 7
n = int(eval(input()))
a = list(map(int, input().split()))
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            pass
        else:
            print("DENIED")
            break
else:
    print("APPROVED")

n = int(eval(input()))
a = list(map(int, input().split()))
s = 1
for i in range(n):
    s = s * a[i]
# sが奇数なら
if s % 2 == 1:
    print("APPROVED")
    exit()
p = []
for i in range(n):
    p.append(1)
z = 0
for i in range(n):
    if a[i] % 2 == 1:
        p[i] = 0
    else:
        if a[i] % 6 == 0:
            p[i] = 0
        elif a[i] % 10 == 0:
            p[i] = 0
    z = z + p[i]
if z == 0:
    print("APPROVED")
else:
    print("DENIED")

-import sys -from collections import * -import heapq -import math -import bisect -from itertools import permutations, accumulate, combinations, product -from fractions import gcd - - -def input(): -    return sys.stdin.readline()[:-1] - - -mod = pow(10, 9) + 7 +s = 1 -    if a[i] % 2 == 0: -        if a[i] % 3 == 0 or a[i] % 5 == 0: -            pass -        else: -            print("DENIED") -            break +    s = s * a[i] +# sが奇数なら +if s % 2 == 1: +    print("APPROVED") +    exit() +p = [] +for i in range(n): +    p.append(1) +z = 0 +for i in range(n): +    if a[i] % 2 == 1: +        p[i] = 0 +    else: +        if a[i] % 6 == 0: +            p[i] = 0 +        elif a[i] % 10 == 0: +            p[i] = 0 +    z = z + p[i] +if z == 0: +    print("APPROVED") -    print("APPROVED") +    print("DENIED")