N = int(input())
A = list(map(int, input().split()))
ans = "APPROVED"

for n in range(N):
    if A[n] % 2 == 1:
        pass
    elif A[n] % 3 == 0:
        pass
    elif A[n] % 5 == 0:
        pass
    else:
        ans = "DENIED"
        break
print(ans) 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 ans = "APPROVED" ans "APPROVED" for n in range(N):
    if A[n] % 2 == 1:
        pass
    elif A[n] % 3 == 0:
        pass
    elif A[n] % 5 == 0:
        pass
    else:
        ans = "DENIED"
        break n range(N) range N if A[n] % 2 == 1:
        pass
    elif A[n] % 3 == 0:
        pass
    elif A[n] % 5 == 0:
        pass
    else:
        ans = "DENIED"
        break A[n] % 2 == 1 A[n] % 2 A[n] A n 2 1 elif A[n] % 3 == 0:
        pass
     A[n] % 3 == 0 A[n] % 3 A[n] A n 3 0 elif A[n] % 5 == 0:
        pass
     A[n] % 5 == 0 A[n] % 5 A[n] A n 5 0 ans = "DENIED" ans "DENIED" break print(ans) print ans N = int(input()) int(input()) N ans = "APPROVED" "APPROVED" ans ans = "DENIED" "DENIED" ans A = list(map(int, input().split())) list(map(int, input().split())) A
N = int(input())
A = list(map(int, input().split()))
ans = "APPROVED"

for n in range(N):
    if A[n] % 2 == 1:
        pass
    elif A[n] % 3 == 0:
        pass
    elif A[n] % 5 == 0:
        pass
    else:
        ans = "DENIED"
        break
print(ans)