n = int(input())
a = list(map(int, input().split()))
def f():
    for i in range(n):
        if a[i] % 2 == 0:
            if a[i] % 3 != 0 and a[i] % 5 != 0:
                return "DENIED"
    return "APPROVED"
print(f()) n = int(input()) n int(input()) int 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 def f():
    for i in range(n):
        if a[i] % 2 == 0:
            if a[i] % 3 != 0 and a[i] % 5 != 0:
                return "DENIED"
    return "APPROVED" f for i in range(n):
        if a[i] % 2 == 0:
            if a[i] % 3 != 0 and a[i] % 5 != 0:
                return "DENIED"
     i range(n) range n if a[i] % 2 == 0:
            if a[i] % 3 != 0 and a[i] % 5 != 0:
                return "DENIED"
     a[i] % 2 == 0 a[i] % 2 a[i] a i 2 0 if a[i] % 3 != 0 and a[i] % 5 != 0:
                return "DENIED"
     a[i] % 3 != 0 and 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 return "DENIED" "DENIED" return "APPROVED" "APPROVED" print(f()) print f() f n = int(input()) int(input()) n def f():
    for i in range(n):
        if a[i] % 2 == 0:
            if a[i] % 3 != 0 and a[i] % 5 != 0:
                return "DENIED"
    return "APPROVED" def f():
    for i in range(n):
        if a[i] % 2 == 0:
            if a[i] % 3 != 0 and a[i] % 5 != 0:
                return "DENIED"
    return "APPROVED" f a = list(map(int, input().split())) list(map(int, input().split())) a
n = int(input())
a = list(map(int, input().split()))
def f():
    for i in range(n):
        if a[i] % 2 == 0:
            if a[i] % 3 != 0 and a[i] % 5 != 0:
                return "DENIED"
    return "APPROVED"
print(f())