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