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 and A[i]%5!=0:

            print('DENIED')

            break

else:

    print('APPROVED')
#!/usr/bin/env python3

#import sys; sys.stdin=open('input_file.txt')

#------------------------------------------

N = int(eval(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')

        break

else:

    print('APPROVED')

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 and A[i] % 5 != 0:
            print("DENIED")
            break
else:
    print("APPROVED")

#!/usr/bin/env python3
# import sys; sys.stdin=open('input_file.txt')
# ------------------------------------------
N = int(eval(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")
        break
else:
    print("APPROVED")

+#!/usr/bin/env python3 +# import sys; sys.stdin=open('input_file.txt') -    if A[i] % 2 == 0: -        if A[i] % 3 != 0 and A[i] % 5 != 0: -            print("DENIED") -            break +    if A[i] % 2 == 0 and A[i] % 3 != 0 and A[i] % 5 != 0: +        print("DENIED") +        break