N=int(input())
Alist=list(map(int,input().split()))
ans=0
for i in range(N):
  if Alist[i]%2==0:
    if Alist[i]%3!=0 and Alist[i]%5!=0:
      ans=1
      break
print("APPROVED"*(1+(-1)*ans)+"DENIED"*ans) N=int(input()) N int(input()) int input() input Alist=list(map(int,input().split())) Alist list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans=0 ans 0 for i in range(N):
  if Alist[i]%2==0:
    if Alist[i]%3!=0 and Alist[i]%5!=0:
      ans=1
      break i range(N) range N if Alist[i]%2==0:
    if Alist[i]%3!=0 and Alist[i]%5!=0:
      ans=1
      break Alist[i]%2==0 Alist[i]%2 Alist[i] Alist i 2 0 if Alist[i]%3!=0 and Alist[i]%5!=0:
      ans=1
      break Alist[i]%3!=0 and Alist[i]%5!=0 Alist[i]%3!=0 Alist[i]%3 Alist[i] Alist i 3 0 Alist[i]%5!=0 Alist[i]%5 Alist[i] Alist i 5 0 ans=1 ans 1 break print("APPROVED"*(1+(-1)*ans)+"DENIED"*ans) print "APPROVED"*(1+(-1)*ans)+"DENIED"*ans "APPROVED"*(1+(-1)*ans) "APPROVED" 1+(-1)*ans 1 (-1)*ans -1 ans "DENIED"*ans "DENIED" ans N=int(input()) int(input()) N ans=0 0 ans Alist=list(map(int,input().split())) list(map(int,input().split())) Alist ans=1 1 ans
N=int(input())
Alist=list(map(int,input().split()))
ans=0
for i in range(N):
  if Alist[i]%2==0:
    if Alist[i]%3!=0 and Alist[i]%5!=0:
      ans=1
      break
print("APPROVED"*(1+(-1)*ans)+"DENIED"*ans)