n = int(input())
m = map(int, input().split())
flag = "APPROVED"

for i in m:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			flag = "DENIED"
    
print(flag) n = int(input()) n int(input()) int input() input m = map(int, input().split()) m map(int, input().split()) map int input().split() ().split () input split flag = "APPROVED" flag "APPROVED" for i in m:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			flag = "DENIED"
     i m if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			flag = "DENIED"
     i % 2 == 0 i % 2 i 2 0 if i % 3 != 0 and i % 5 != 0:
			flag = "DENIED"
     i % 3 != 0 and i % 5 != 0 i % 3 != 0 i % 3 i 3 0 i % 5 != 0 i % 5 i 5 0 flag = "DENIED" flag "DENIED" print(flag) print flag n = int(input()) int(input()) n flag = "APPROVED" "APPROVED" flag flag = "DENIED" "DENIED" flag m = map(int, input().split()) map(int, input().split()) m
n = int(input())
m = map(int, input().split())
flag = "APPROVED"

for i in m:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			flag = "DENIED"
    
print(flag)
