n = int(eval(input()))

list_num = list(map(int, input().split()))

flg = False

for i in range(n):

  if list_num[i] % 2 == 1 or (list_num[i] % 2 == 0 and (list_num[i] % 3 == 0 or list_num[i] % 5 == 0)):

    flg = True

  else:

    flg = False

    break



if flg:

  print("APPROVED")

else:

  print("DENIED")
n = int(eval(input()))

numbers = list(map(int, input().split()))

flg = True

for number in numbers:

    if number % 2 == 0 and number % 3 != 0 and number % 5 != 0:

        flg = False

        break



if flg:

    print("APPROVED")

else:

    print("DENIED")
n = int(eval(input()))
list_num = list(map(int, input().split()))
flg = False
for i in range(n):
    if list_num[i] % 2 == 1 or (
        list_num[i] % 2 == 0 and (list_num[i] % 3 == 0 or list_num[i] % 5 == 0)
    ):
        flg = True
    else:
        flg = False
        break
if flg:
    print("APPROVED")
else:
    print("DENIED")

n = int(eval(input()))
numbers = list(map(int, input().split()))
flg = True
for number in numbers:
    if number % 2 == 0 and number % 3 != 0 and number % 5 != 0:
        flg = False
        break
if flg:
    print("APPROVED")
else:
    print("DENIED")

-list_num = list(map(int, input().split())) -flg = False -for i in range(n): -    if list_num[i] % 2 == 1 or ( -        list_num[i] % 2 == 0 and (list_num[i] % 3 == 0 or list_num[i] % 5 == 0) -    ): -        flg = True -    else: +numbers = list(map(int, input().split())) +flg = True +for number in numbers: +    if number % 2 == 0 and number % 3 != 0 and number % 5 != 0: