n=int(eval(input()))

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

ans=True

for i in a:

    if not i%2 and i%3 and i%5:

        ans=False

        break

print(('APPROVED' if ans else 'DENIED'))
n,*a=list(map(int,open(0).read().split()))

print(("DENIED" if sum((i%3)*(i%5) for i in a if i%2==0) else "APPROVED"))
n = int(eval(input()))
a = list(map(int, input().split()))
ans = True
for i in a:
    if not i % 2 and i % 3 and i % 5:
        ans = False
        break
print(("APPROVED" if ans else "DENIED"))

n, *a = list(map(int, open(0).read().split()))
print(("DENIED" if sum((i % 3) * (i % 5) for i in a if i % 2 == 0) else "APPROVED"))

-n = int(eval(input())) -a = list(map(int, input().split())) -ans = True -for i in a: -    if not i % 2 and i % 3 and i % 5: -        ans = False -        break -print(("APPROVED" if ans else "DENIED")) +n, *a = list(map(int, open(0).read().split())) +print(("DENIED" if sum((i % 3) * (i % 5) for i in a if i % 2 == 0) else "APPROVED"))