n = int(input())
a = map(int,input().split())
ans = "APPROVED"

for i in a:
  if i%2 == 0:
    if not(i%3==0 or i%5==0):
      ans = "DENIED"

print(ans) n = int(input()) n int(input()) int input() input a = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split ans = "APPROVED" ans "APPROVED" for i in a:
  if i%2 == 0:
    if not(i%3==0 or i%5==0):
      ans = "DENIED" i a if i%2 == 0:
    if not(i%3==0 or i%5==0):
      ans = "DENIED" i%2 == 0 i%2 i 2 0 if not(i%3==0 or i%5==0):
      ans = "DENIED" not(i%3==0 or i%5==0) i%3==0 or i%5==0 i%3==0 i%3 i 3 0 i%5==0 i%5 i 5 0 ans = "DENIED" ans "DENIED" print(ans) print ans ans = "APPROVED" "APPROVED" ans n = int(input()) int(input()) n a = map(int,input().split()) map(int,input().split()) a ans = "DENIED" "DENIED" ans
n = int(input())
a = map(int,input().split())
ans = "APPROVED"

for i in a:
  if i%2 == 0:
    if not(i%3==0 or i%5==0):
      ans = "DENIED"

print(ans)