n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(n):
  if a[i]%2==0:
    if a[i]%3 !=0:
      if a[i]%5 !=0:
        b.append(0)
        break
if 0 in b:
  print('DENIED')
else:
  print('APPROVED') n=int(input()) n int(input()) int input() input a=list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split b=[] b [] for i in range(n):
  if a[i]%2==0:
    if a[i]%3 !=0:
      if a[i]%5 !=0:
        b.append(0)
        break i range(n) range n if a[i]%2==0:
    if a[i]%3 !=0:
      if a[i]%5 !=0:
        b.append(0)
        break a[i]%2==0 a[i]%2 a[i] a i 2 0 if a[i]%3 !=0:
      if a[i]%5 !=0:
        b.append(0)
        break a[i]%3 !=0 a[i]%3 a[i] a i 3 0 if a[i]%5 !=0:
        b.append(0)
        break a[i]%5 !=0 a[i]%5 a[i] a i 5 0 b.append(0) b.append b append 0 break if 0 in b:
  print('DENIED')
else:
  print('APPROVED') 0 in b 0 b print('DENIED') print 'DENIED' print('APPROVED') print 'APPROVED' a=list(map(int,input().split())) list(map(int,input().split())) a b=[] [] b n=int(input()) int(input()) n
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(n):
  if a[i]%2==0:
    if a[i]%3 !=0:
      if a[i]%5 !=0:
        b.append(0)
        break
if 0 in b:
  print('DENIED')
else:
  print('APPROVED')