N=int(input())
L=list(map(int,input().split()))
T=True
for i in L:
  if not(i%3==0 or i%5==0) and i%2==0:
    T=False
if T==True:
  print("APPROVED")
else:
  print("DENIED") N=int(input()) N int(input()) int input() input L=list(map(int,input().split())) L list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split T=True T True for i in L:
  if not(i%3==0 or i%5==0) and i%2==0:
    T=False i L if not(i%3==0 or i%5==0) and i%2==0:
    T=False not(i%3==0 or i%5==0) and i%2==0 not(i%3==0 or i%5==0) i%3==0 or i%5==0 i%3==0 i%3 i 3 0 i%5==0 i%5 i 5 0 i%2==0 i%2 i 2 0 T=False T False if T==True:
  print("APPROVED")
else:
  print("DENIED") T==True T True print("APPROVED") print "APPROVED" print("DENIED") print "DENIED" N=int(input()) int(input()) N L=list(map(int,input().split())) list(map(int,input().split())) L T=False False T T=True True T
N=int(input())
L=list(map(int,input().split()))
T=True
for i in L:
  if not(i%3==0 or i%5==0) and i%2==0:
    T=False
if T==True:
  print("APPROVED")
else:
  print("DENIED")