N = int(eval(input()))

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

for a in A:

  if a % 2 == 1:

    continue

  if a % 3 == 0 or a % 5 == 0:

    continue

  print("DENIED")

  exit()

print("APPROVED")

N = int(eval(input()))

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

         

for a in A:

      if a % 2 == 1:

         continue

      if a % 3 == 0:

         continue

      if a % 5 == 0:

         continue

      print("DENIED")

      exit()



print("APPROVED")  
N = int(eval(input()))
A = list(map(int, input().split()))
for a in A:
    if a % 2 == 1:
        continue
    if a % 3 == 0 or a % 5 == 0:
        continue
    print("DENIED")
    exit()
print("APPROVED")

N = int(eval(input()))
A = list(map(int, input().split()))
for a in A:
    if a % 2 == 1:
        continue
    if a % 3 == 0:
        continue
    if a % 5 == 0:
        continue
    print("DENIED")
    exit()
print("APPROVED")

-    if a % 3 == 0 or a % 5 == 0: +    if a % 3 == 0: +        continue +    if a % 5 == 0: