a=int(input())
b=list(map(int,input().split()))
c=0
for i in range(a):
  if b[i]%2==0:
    if b[i]%3==0 or b[i]%5==0:
      c=c+1
  else:
    c=c+1
if c==a:
  print("APPROVED")
else:
  print("DENIED") a=int(input()) a int(input()) int input() input b=list(map(int,input().split())) b list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split c=0 c 0 for i in range(a):
  if b[i]%2==0:
    if b[i]%3==0 or b[i]%5==0:
      c=c+1
  else:
    c=c+1 i range(a) range a if b[i]%2==0:
    if b[i]%3==0 or b[i]%5==0:
      c=c+1
  else:
    c=c+1 b[i]%2==0 b[i]%2 b[i] b i 2 0 if b[i]%3==0 or b[i]%5==0:
      c=c+1
   b[i]%3==0 or b[i]%5==0 b[i]%3==0 b[i]%3 b[i] b i 3 0 b[i]%5==0 b[i]%5 b[i] b i 5 0 c=c+1 c c+1 c 1 c=c+1 c c+1 c 1 if c==a:
  print("APPROVED")
else:
  print("DENIED") c==a c a print("APPROVED") print "APPROVED" print("DENIED") print "DENIED" b=list(map(int,input().split())) list(map(int,input().split())) b c=c+1 c+1 c a=int(input()) int(input()) a c=0 0 c c=c+1 c+1 c
a=int(input())
b=list(map(int,input().split()))
c=0
for i in range(a):
  if b[i]%2==0:
    if b[i]%3==0 or b[i]%5==0:
      c=c+1
  else:
    c=c+1
if c==a:
  print("APPROVED")
else:
  print("DENIED")