n = int(input())
a = list(map(int, input().split()))
x = "APPROVED"
for i in range(n):
    if a[i] == (2 * int(a[i] / 2)):
        if a[i] != (3 * int(a[i] / 3)):
            if a[i] != (5 * int(a[i] / 5)):
                x = "DENIED"
print(str(x)) 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 x = "APPROVED" x "APPROVED" for i in range(n):
    if a[i] == (2 * int(a[i] / 2)):
        if a[i] != (3 * int(a[i] / 3)):
            if a[i] != (5 * int(a[i] / 5)):
                x = "DENIED" i range(n) range n if a[i] == (2 * int(a[i] / 2)):
        if a[i] != (3 * int(a[i] / 3)):
            if a[i] != (5 * int(a[i] / 5)):
                x = "DENIED" a[i] == (2 * int(a[i] / 2)) a[i] a i 2 * int(a[i] / 2) 2 int(a[i] / 2) int a[i] / 2 a[i] a i 2 if a[i] != (3 * int(a[i] / 3)):
            if a[i] != (5 * int(a[i] / 5)):
                x = "DENIED" a[i] != (3 * int(a[i] / 3)) a[i] a i 3 * int(a[i] / 3) 3 int(a[i] / 3) int a[i] / 3 a[i] a i 3 if a[i] != (5 * int(a[i] / 5)):
                x = "DENIED" a[i] != (5 * int(a[i] / 5)) a[i] a i 5 * int(a[i] / 5) 5 int(a[i] / 5) int a[i] / 5 a[i] a i 5 x = "DENIED" x "DENIED" print(str(x)) print str(x) str x n = int(input()) int(input()) n x = "DENIED" "DENIED" x x = "APPROVED" "APPROVED" x a = list(map(int, input().split())) list(map(int, input().split())) a
n = int(input())
a = list(map(int, input().split()))
x = "APPROVED"
for i in range(n):
    if a[i] == (2 * int(a[i] / 2)):
        if a[i] != (3 * int(a[i] / 3)):
            if a[i] != (5 * int(a[i] / 5)):
                x = "DENIED"
print(str(x))