input()
a=[a for a in map(int,input().split())if a%2==0]
r="DENIED"
for i in a:
	if i%3 and i%5:break
else: r="APPROVED"
print(r) input() input a for a in map(int,input().split())if a%2==0 for a in map(int,input().split())if a%2==0 a map(int,input().split()) map int input().split() ().split () input split a%2==0 a%2 a 2 0 if a%2==0 a a=[a for a in map(int,input().split())if a%2==0] a [a for a in map(int,input().split())if a%2==0] r="DENIED" r "DENIED" for i in a:
	if i%3 and i%5:break
else: r="APPROVED" i a if i%3 and i%5:brea i%3 and i%5 i%3 i 3 i%5 i 5 print(r) print r r="DENIED" "DENIED" r a=[a for a in map(int,input().split())if a%2==0] [a for a in map(int,input().split())if a%2==0] a
input()
a=[a for a in map(int,input().split())if a%2==0]
r="DENIED"
for i in a:
	if i%3 and i%5:break
else: r="APPROVED"
print(r)