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

for i in range(n):
    no = a[i]
    if (no%2==0) and (no%3!=0) and (no%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 for i in range(n):
    no = a[i]
    if (no%2==0) and (no%3!=0) and (no%5!=0):
        print('DENIED')
        exit() i range(n) range n no = a[i] no a[i] a i if (no%2==0) and (no%3!=0) and (no%5!=0):
        print('DENIED')
        exit() (no%2==0) and (no%3!=0) and (no%5!=0) (no%2==0) and (no%3!=0) no%2==0 no%2 no 2 0 no%3!=0 no%3 no 3 0 no%5!=0 no%5 no 5 0 print('DENIED') print 'DENIED' exit() exit print('APPROVED') print 'APPROVED' no = a[i] a[i] no 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()))

for i in range(n):
    no = a[i]
    if (no%2==0) and (no%3!=0) and (no%5!=0):
        print('DENIED')
        exit()
print('APPROVED')