n=int(input())
li=list(map(int,input().split()))
for i in li:
  if i%2==0:
    if i%3==0 or i%5==0:
      pass
    else:
      print("DENIED")
      break
else:
  print("APPROVED") n=int(input()) n int(input()) int input() input li=list(map(int,input().split())) li list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split for i in li:
  if i%2==0:
    if i%3==0 or i%5==0:
      pass
    else:
      print("DENIED")
      break
else:
  print("APPROVED") i li if i%2==0:
    if i%3==0 or i%5==0:
      pass
    else:
      print("DENIED")
      break i%2==0 i%2 i 2 0 if i%3==0 or i%5==0:
      pass
    else:
      print("DENIED")
      break i%3==0 or i%5==0 i%3==0 i%3 i 3 0 i%5==0 i%5 i 5 0 print("DENIED") print "DENIED" break print("APPROVED") print "APPROVED" n=int(input()) int(input()) n li=list(map(int,input().split())) list(map(int,input().split())) li
n=int(input())
li=list(map(int,input().split()))
for i in li:
  if i%2==0:
    if i%3==0 or i%5==0:
      pass
    else:
      print("DENIED")
      break
else:
  print("APPROVED")