N = input()

a =  list(map(int,input().split()))
b = 0
c = 0
for i in range(len(a)):
    if a[i] % 2 == 0:
        b+=1
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            c+=1
if b == c:
    print('APPROVED')
else:
    print('DENIED') N = input() N input() input a =  list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split b = 0 b 0 c = 0 c 0 for i in range(len(a)):
    if a[i] % 2 == 0:
        b+=1
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            c+=1 i range(len(a)) range len(a) len a if a[i] % 2 == 0:
        b+=1
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            c+=1 a[i] % 2 == 0 a[i] % 2 a[i] a i 2 0 b+=1 b 1 if a[i] % 3 == 0 or a[i] % 5 == 0:
            c+=1 a[i] % 3 == 0 or a[i] % 5 == 0 a[i] % 3 == 0 a[i] % 3 a[i] a i 3 0 a[i] % 5 == 0 a[i] % 5 a[i] a i 5 0 c+=1 c 1 if b == c:
    print('APPROVED')
else:
    print('DENIED') b == c b c print('APPROVED') print 'APPROVED' print('DENIED') print 'DENIED' b = 0 0 b c = 0 0 c b+=1 1 b c+=1 1 c a =  list(map(int,input().split())) list(map(int,input().split())) a N = input() input() N
N = input()

a =  list(map(int,input().split()))
b = 0
c = 0
for i in range(len(a)):
    if a[i] % 2 == 0:
        b+=1
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            c+=1
if b == c:
    print('APPROVED')
else:
    print('DENIED')