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

ans = "APPROVED"

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

ans = "APPROVED"

for n in range(N):
  if A[n] %2 == 0:
    if A[n] % 3 != 0 and A[n] % 5 != 0:
      ans = "DENIED"
      break
print(ans)