total_number = int(input())
number = list(map(int, input().split()))
for value in number:
    if value % 2 == 0 and (value % 3 != 0 and value % 5 != 0):
        print("DENIED")
        quit()
print("APPROVED") total_number = int(input()) total_number int(input()) int input() input number = list(map(int, input().split())) number list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for value in number:
    if value % 2 == 0 and (value % 3 != 0 and value % 5 != 0):
        print("DENIED")
        quit() value number if value % 2 == 0 and (value % 3 != 0 and value % 5 != 0):
        print("DENIED")
        quit() value % 2 == 0 and (value % 3 != 0 and value % 5 != 0) value % 2 == 0 value % 2 value 2 0 value % 3 != 0 and value % 5 != 0 value % 3 != 0 value % 3 value 3 0 value % 5 != 0 value % 5 value 5 0 print("DENIED") print "DENIED" quit() quit print("APPROVED") print "APPROVED" total_number = int(input()) int(input()) total_number number = list(map(int, input().split())) list(map(int, input().split())) number
total_number = int(input())
number = list(map(int, input().split()))
for value in number:
    if value % 2 == 0 and (value % 3 != 0 and value % 5 != 0):
        print("DENIED")
        quit()
print("APPROVED")