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