n = int(input())
li = list(map(int,input().split()))
s = 0
for i in range(n):
    if li[i] % 2 == 0:
        if li[i] % 3 == 0 or li[i] % 5 == 0:
            continue
        else:
            s = 1
    else:
        continue
if s == 1:
    print("DENIED")
else:
    print("APPROVED") n = int(input()) n int(input()) int input() input li = list(map(int,input().split())) li list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split s = 0 s 0 for i in range(n):
    if li[i] % 2 == 0:
        if li[i] % 3 == 0 or li[i] % 5 == 0:
            continue
        else:
            s = 1
    else:
        continue i range(n) range n if li[i] % 2 == 0:
        if li[i] % 3 == 0 or li[i] % 5 == 0:
            continue
        else:
            s = 1
    else:
        continue li[i] % 2 == 0 li[i] % 2 li[i] li i 2 0 if li[i] % 3 == 0 or li[i] % 5 == 0:
            continue
        else:
            s = 1
     li[i] % 3 == 0 or li[i] % 5 == 0 li[i] % 3 == 0 li[i] % 3 li[i] li i 3 0 li[i] % 5 == 0 li[i] % 5 li[i] li i 5 0 continue s = 1 s 1 continue if s == 1:
    print("DENIED")
else:
    print("APPROVED") s == 1 s 1 print("DENIED") print "DENIED" print("APPROVED") print "APPROVED" li = list(map(int,input().split())) list(map(int,input().split())) li s = 0 0 s n = int(input()) int(input()) n s = 1 1 s
n = int(input())
li = list(map(int,input().split()))
s = 0
for i in range(n):
    if li[i] % 2 == 0:
        if li[i] % 3 == 0 or li[i] % 5 == 0:
            continue
        else:
            s = 1
    else:
        continue
if s == 1:
    print("DENIED")
else:
    print("APPROVED")