N = int(input())
N_List = list(map(int,input().split()))

X = [x for x in N_List if x % 2 ==0]
Y = [y for y in X if y % 3 ==0 or y % 5 ==0]

if len(X) == len(Y):
    print("APPROVED")
else:
    print("DENIED") N = int(input()) N int(input()) int input() input N_List = list(map(int,input().split())) N_List list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split x for x in N_List if x % 2 ==0 for x in N_List if x % 2 ==0 x N_List x % 2 ==0 x % 2 x 2 0 if x % 2 ==0 x X = [x for x in N_List if x % 2 ==0] X [x for x in N_List if x % 2 ==0] y for y in X if y % 3 ==0 or y % 5 ==0 for y in X if y % 3 ==0 or y % 5 ==0 y X y % 3 ==0 or y % 5 ==0 y % 3 ==0 y % 3 y 3 0 y % 5 ==0 y % 5 y 5 0 if y % 3 ==0 or y % 5 ==0 y Y = [y for y in X if y % 3 ==0 or y % 5 ==0] Y [y for y in X if y % 3 ==0 or y % 5 ==0] if len(X) == len(Y):
    print("APPROVED")
else:
    print("DENIED") len(X) == len(Y) len(X) len X len(Y) len Y print("APPROVED") print "APPROVED" print("DENIED") print "DENIED" Y = [y for y in X if y % 3 ==0 or y % 5 ==0] [y for y in X if y % 3 ==0 or y % 5 ==0] Y X = [x for x in N_List if x % 2 ==0] [x for x in N_List if x % 2 ==0] X N = int(input()) int(input()) N N_List = list(map(int,input().split())) list(map(int,input().split())) N_List
N = int(input())
N_List = list(map(int,input().split()))

X = [x for x in N_List if x % 2 ==0]
Y = [y for y in X if y % 3 ==0 or y % 5 ==0]

if len(X) == len(Y):
    print("APPROVED")
else:
    print("DENIED")