n = int(input())
a = list(map(int, input().split()))
b = []

for i in range(n):
  if a[i] % 2 == 0:
    b.append(a[i])

for j in b:
  if j % 3 != 0 and j % 5 != 0:
    print('DENIED')
    exit()
    
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:
    b.append(a[i]) i range(n) range n if a[i] % 2 == 0:
    b.append(a[i]) a[i] % 2 == 0 a[i] % 2 a[i] a i 2 0 b.append(a[i]) b.append b append a[i] a i for j in b:
  if j % 3 != 0 and j % 5 != 0:
    print('DENIED')
    exit()
     j b if j % 3 != 0 and j % 5 != 0:
    print('DENIED')
    exit()
     j % 3 != 0 and j % 5 != 0 j % 3 != 0 j % 3 j 3 0 j % 5 != 0 j % 5 j 5 0 print('DENIED') print 'DENIED' exit() exit print('APPROVED') print 'APPROVED' b = [] [] b n = int(input()) int(input()) n a = list(map(int, input().split())) list(map(int, input().split())) a
n = int(input())
a = list(map(int, input().split()))
b = []

for i in range(n):
  if a[i] % 2 == 0:
    b.append(a[i])

for j in b:
  if j % 3 != 0 and j % 5 != 0:
    print('DENIED')
    exit()
    
print('APPROVED')