input()
A=list(map(int,input().split()))

def even(num, l):
    if num % 2 == 0:
        l.append(num)
        
B = []
for num in A:
    even(num, B)
    
C = []
for nn in B:
  if nn % 3 != 0 and nn % 5 != 0:
    C.append(nn)
    
if len(C) == 0:
  print('APPROVED')
else:
  print('DENIED') 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 def even(num, l):
    if num % 2 == 0:
        l.append(num)
         even if num % 2 == 0:
        l.append(num)
         num % 2 == 0 num % 2 num 2 0 l.append(num) l.append l append num num num l l B = [] B [] for num in A:
    even(num, B)
     num A even(num, B) even num B C = [] C [] for nn in B:
  if nn % 3 != 0 and nn % 5 != 0:
    C.append(nn)
     nn B if nn % 3 != 0 and nn % 5 != 0:
    C.append(nn)
     nn % 3 != 0 and nn % 5 != 0 nn % 3 != 0 nn % 3 nn 3 0 nn % 5 != 0 nn % 5 nn 5 0 C.append(nn) C.append C append nn if len(C) == 0:
  print('APPROVED')
else:
  print('DENIED') len(C) == 0 len(C) len C 0 print('APPROVED') print 'APPROVED' print('DENIED') print 'DENIED' B = [] [] B def even(num, l):
    if num % 2 == 0:
        l.append(num)
         def even(num, l):
    if num % 2 == 0:
        l.append(num)
         even C = [] [] C A=list(map(int,input().split())) list(map(int,input().split())) A
input()
A=list(map(int,input().split()))

def even(num, l):
    if num % 2 == 0:
        l.append(num)
        
B = []
for num in A:
    even(num, B)
    
C = []
for nn in B:
  if nn % 3 != 0 and nn % 5 != 0:
    C.append(nn)
    
if len(C) == 0:
  print('APPROVED')
else:
  print('DENIED')