N = int(input())
S = list(map(int,input().split()))
B= list()
X = list()
for i in S:
    if i % 2== 0:
        B.append(i)
for n in B:
    if n % 3 == 0 or n % 5 == 0:
        X.append(n)
if len(B) == len(X):
    print('APPROVED')
else:
    print('DENIED')

 N = int(input()) N int(input()) int input() input S = list(map(int,input().split())) S list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split B= list() B list() list X = list() X list() list for i in S:
    if i % 2== 0:
        B.append(i) i S if i % 2== 0:
        B.append(i) i % 2== 0 i % 2 i 2 0 B.append(i) B.append B append i for n in B:
    if n % 3 == 0 or n % 5 == 0:
        X.append(n) n B if n % 3 == 0 or n % 5 == 0:
        X.append(n) n % 3 == 0 or n % 5 == 0 n % 3 == 0 n % 3 n 3 0 n % 5 == 0 n % 5 n 5 0 X.append(n) X.append X append n if len(B) == len(X):
    print('APPROVED')
else:
    print('DENIED') len(B) == len(X) len(B) len B len(X) len X print('APPROVED') print 'APPROVED' print('DENIED') print 'DENIED' B= list() list() B S = list(map(int,input().split())) list(map(int,input().split())) S X = list() list() X N = int(input()) int(input()) N
N = int(input())
S = list(map(int,input().split()))
B= list()
X = list()
for i in S:
    if i % 2== 0:
        B.append(i)
for n in B:
    if n % 3 == 0 or n % 5 == 0:
        X.append(n)
if len(B) == len(X):
    print('APPROVED')
else:
    print('DENIED')


