N=input()
I=list(map(int,input().split()))
E=list(filter(lambda x:x%2==0,I))
if len(E)==0:
    print('APPROVED')
else:
    O=list(filter(lambda r:r%3!=0 and r%5!=0,E))
    if len(O)==0:
        print('APPROVED')
    else:
        print('DENIED') N=input() N input() input I=list(map(int,input().split())) I list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split E=list(filter(lambda x:x%2==0,I)) E list(filter(lambda x:x%2==0,I)) list filter(lambda x:x%2==0,I) filter lambda x:x%2==0 x%2==0 x%2 x 2 0 x I if len(E)==0:
    print('APPROVED')
else:
    O=list(filter(lambda r:r%3!=0 and r%5!=0,E))
    if len(O)==0:
        print('APPROVED')
    else:
        print('DENIED') len(E)==0 len(E) len E 0 print('APPROVED') print 'APPROVED' O=list(filter(lambda r:r%3!=0 and r%5!=0,E)) O list(filter(lambda r:r%3!=0 and r%5!=0,E)) list filter(lambda r:r%3!=0 and r%5!=0,E) filter lambda r:r%3!=0 and r%5!=0 r%3!=0 and r%5!=0 r%3!=0 r%3 r 3 0 r%5!=0 r%5 r 5 0 r E if len(O)==0:
        print('APPROVED')
    else:
        print('DENIED') len(O)==0 len(O) len O 0 print('APPROVED') print 'APPROVED' print('DENIED') print 'DENIED' E=list(filter(lambda x:x%2==0,I)) list(filter(lambda x:x%2==0,I)) E N=input() input() N O=list(filter(lambda r:r%3!=0 and r%5!=0,E)) list(filter(lambda r:r%3!=0 and r%5!=0,E)) O I=list(map(int,input().split())) list(map(int,input().split())) I
N=input()
I=list(map(int,input().split()))
E=list(filter(lambda x:x%2==0,I))
if len(E)==0:
    print('APPROVED')
else:
    O=list(filter(lambda r:r%3!=0 and r%5!=0,E))
    if len(O)==0:
        print('APPROVED')
    else:
        print('DENIED')