N = int(input())
A = list(map(int,input().split(" ")))
B = ["APPROVED","DENIED"]
t = 0

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

for i in A:
  if i%2 == 0:
    if i%3 != 0 and i%5 != 0:
      t = 1
      break
print(B[t])