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

ans = "APPROVED"
for x in a:
  if (x % 2 == 0):
    if (x % 3 != 0 and x % 5 != 0):
      ans = "DENIED"
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 x in a:
  if (x % 2 == 0):
    if (x % 3 != 0 and x % 5 != 0):
      ans = "DENIED" x a if (x % 2 == 0):
    if (x % 3 != 0 and x % 5 != 0):
      ans = "DENIED" x % 2 == 0 x % 2 x 2 0 if (x % 3 != 0 and x % 5 != 0):
      ans = "DENIED" x % 3 != 0 and x % 5 != 0 x % 3 != 0 x % 3 x 3 0 x % 5 != 0 x % 5 x 5 0 ans = "DENIED" ans "DENIED" print(ans) print ans ans = "APPROVED" "APPROVED" ans ans = "DENIED" "DENIED" ans 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()))

ans = "APPROVED"
for x in a:
  if (x % 2 == 0):
    if (x % 3 != 0 and x % 5 != 0):
      ans = "DENIED"
print(ans)