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")
3f3a51b68f72ac5d3c033b7fecf789063cbe6913
<mask token>

<mask token>
if len(X) == len(Y):
    print('APPROVED')
else:
    print('DENIED')

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_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")