N = int(eval(input()))

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



ans = 'APPROVED'



for a in AA:

    if a % 2 == 0:

        if a % 3 != 0 and a % 5 != 0:

            ans = 'DENIED'

            break

            

print(ans)
import sys

n=int(eval(input()))

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

for i in range(len(a)):

    if a[i]%2==0:

        if a[i]%3!=0 and a[i]%5!=0:

            print('DENIED')

            sys.exit()

print('APPROVED')
N = int(eval(input()))
AA = list(map(int, input().split()))
ans = "APPROVED"
for a in AA:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            ans = "DENIED"
            break
print(ans)

import sys

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

-N = int(eval(input())) -AA = list(map(int, input().split())) -ans = "APPROVED" -for a in AA: -    if a % 2 == 0: -        if a % 3 != 0 and a % 5 != 0: -            ans = "DENIED" -            break -print(ans) +import sys + +n = int(eval(input())) +a = list(map(int, input().split())) +for i in range(len(a)): +    if a[i] % 2 == 0: +        if a[i] % 3 != 0 and a[i] % 5 != 0: +            print("DENIED") +            sys.exit() +print("APPROVED")