N = int(eval(input()))#.split()

A = input().split()

den = False

for i in range(N):

    if int(A[i]) % 2 == 0:

        if int(A[i]) % 3 != 0 and int(A[i]) % 5 != 0:

            print("DENIED")

            exit(0)

            den = True

if not den:

    print("APPROVED")

N = int(eval(input()))

A = input().split()

for i in range(N):

    if int(A[i])%2==0:

        if int(A[i])%3!=0 and int(A[i])%5!=0:

            print("DENIED")

            exit(0)

print("APPROVED")







N = int(eval(input()))  # .split()
A = input().split()
den = False
for i in range(N):
    if int(A[i]) % 2 == 0:
        if int(A[i]) % 3 != 0 and int(A[i]) % 5 != 0:
            print("DENIED")
            exit(0)
            den = True
if not den:
    print("APPROVED")

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

-N = int(eval(input()))  # .split() +N = int(eval(input())) -den = False -            den = True -if not den: -    print("APPROVED") +print("APPROVED")