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

kotae='APPROVED'
for i in range(len(x)):
    if x[i]%2==0:
        if x[i]%3==0 or x[i]%5==0:
            pass
        else:
            kotae='DENIED'


print(kotae) A = int(input()) A int(input()) int input() input x = list(map(int, input().split())) x list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split kotae='APPROVED' kotae 'APPROVED' for i in range(len(x)):
    if x[i]%2==0:
        if x[i]%3==0 or x[i]%5==0:
            pass
        else:
            kotae='DENIED' i range(len(x)) range len(x) len x if x[i]%2==0:
        if x[i]%3==0 or x[i]%5==0:
            pass
        else:
            kotae='DENIED' x[i]%2==0 x[i]%2 x[i] x i 2 0 if x[i]%3==0 or x[i]%5==0:
            pass
        else:
            kotae='DENIED' x[i]%3==0 or x[i]%5==0 x[i]%3==0 x[i]%3 x[i] x i 3 0 x[i]%5==0 x[i]%5 x[i] x i 5 0 kotae='DENIED' kotae 'DENIED' print(kotae) print kotae A = int(input()) int(input()) A x = list(map(int, input().split())) list(map(int, input().split())) x kotae='APPROVED' 'APPROVED' kotae kotae='DENIED' 'DENIED' kotae
A = int(input())
x = list(map(int, input().split()))

kotae='APPROVED'
for i in range(len(x)):
    if x[i]%2==0:
        if x[i]%3==0 or x[i]%5==0:
            pass
        else:
            kotae='DENIED'


print(kotae)
