N=int(input())
S=[int(s) for s in input().split()]
for i in range(N):
    if S[i]%2==0 and S[i]%5!=0 and S[i]%3!=0:
        print("DENIED")
        break
    elif i==N-1:
        print("APPROVED") N=int(input()) N int(input()) int input() input int(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() int(s) int s S=[int(s) for s in input().split()] S [int(s) for s in input().split()] for i in range(N):
    if S[i]%2==0 and S[i]%5!=0 and S[i]%3!=0:
        print("DENIED")
        break
    elif i==N-1:
        print("APPROVED") i range(N) range N if S[i]%2==0 and S[i]%5!=0 and S[i]%3!=0:
        print("DENIED")
        break
    elif i==N-1:
        print("APPROVED") S[i]%2==0 and S[i]%5!=0 and S[i]%3!=0 S[i]%2==0 and S[i]%5!=0 S[i]%2==0 S[i]%2 S[i] S i 2 0 S[i]%5!=0 S[i]%5 S[i] S i 5 0 S[i]%3!=0 S[i]%3 S[i] S i 3 0 print("DENIED") print "DENIED" break elif i==N-1:
        print("APPROVED") i==N-1 i N-1 N 1 print("APPROVED") print "APPROVED" N=int(input()) int(input()) N S=[int(s) for s in input().split()] [int(s) for s in input().split()] S
N=int(input())
S=[int(s) for s in input().split()]
for i in range(N):
    if S[i]%2==0 and S[i]%5!=0 and S[i]%3!=0:
        print("DENIED")
        break
    elif i==N-1:
        print("APPROVED")