def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    ans = 'APPROVED'
    for i in a:
        if i%2:continue
        if i%3!=0 and i%5!=0:
            ans = 'DENIED'
    print(ans)
resolve() def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    ans = 'APPROVED'
    for i in a:
        if i%2:continue
        if i%3!=0 and i%5!=0:
            ans = 'DENIED'
    print(ans) resolve n = int(input()) n int(input()) int input() input a = tuple(map(int,input().split())) a tuple(map(int,input().split())) tuple map(int,input().split()) map int input().split() ().split () input split ans = 'APPROVED' ans 'APPROVED' for i in a:
        if i%2:continue
        if i%3!=0 and i%5!=0:
            ans = 'DENIED'
     i a if i%2:continue
         i%2 i 2 if i%3!=0 and i%5!=0:
            ans = 'DENIED'
     i%3!=0 and i%5!=0 i%3!=0 i%3 i 3 0 i%5!=0 i%5 i 5 0 ans = 'DENIED' ans 'DENIED' print(ans) print ans resolve() resolve def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    ans = 'APPROVED'
    for i in a:
        if i%2:continue
        if i%3!=0 and i%5!=0:
            ans = 'DENIED'
    print(ans) def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    ans = 'APPROVED'
    for i in a:
        if i%2:continue
        if i%3!=0 and i%5!=0:
            ans = 'DENIED'
    print(ans) resolve
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    ans = 'APPROVED'
    for i in a:
        if i%2:continue
        if i%3!=0 and i%5!=0:
            ans = 'DENIED'
    print(ans)
resolve()