peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
list_n = list(map(int, input().split()))
flag = 0
for i in range(N):
  if list_n[i] % 2 == 0:
    if (list_n[i] % 3 != 0) and (list_n[i] % 5 != 0):
      print('DENIED')
      flag = 1
      break
    else:
      continue
if flag == 0:
  print('APPROVED')
num = input()
li = input().split()
judge = True

for li_num in li :
 if int(li_num) % 2 == 0:
  if not(int(li_num) % 3 == 0) and not(int(li_num) % 5 == 0) :
   judge = False
   break

if judge :
  print("APPROVED")
else :
  print("DENIED")
N = int(input())
A = list(map(int, input().split()))
for a in A:
    if a % 2 == 0 and not (a % 3 == 0 or a % 5 == 0):
        print("DENIED")
        exit()
print("APPROVED")
N = int(input())
a = list(map(int,input().split()))
for i in range(N):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            print("DENIED")
            exit(0)
print("APPROVED")
n = int(input())
a = list(map(int, input().split()))
b = True
for x in a:
    if x%2 == 0:
        if x%3 != 0 and x%5 != 0:
            b = False
print("APPROVED" if b else "DENIED")
n=int(input())
a = list(map(int,input().split()))
for i in range(n):
    if a[i]%2==0:
        if a[i]%3!=0 and a[i]%5!=0:
            print("DENIED")
            break
else:
    print("APPROVED")
N=int(input())
A=list(map(int,input().split()))

for i in range(N):
  if A[i]%2==0:
    if A[i]%3!=0 and A[i]%5!=0:
      print('DENIED')
      exit()

print('APPROVED')
x = input()
li = list(map(int,input().split()))
s =[]
for i in range(len(li)):
    if li[i] % 2 == 0:
        s.append(li[i])
o = True
for k in range(len(s)):
    if s[k] % 3 != 0 and s[k] % 5 != 0:
        o = False
    else:
        continue
if o:
    print('APPROVED')
else:
    print('DENIED')
# coding: utf-8

num = int(input())
number = input().split()
count, count2 = 0, 0
table = list(number)
for i in number:
    if int(i) % 2 == 0:
        count += 1
        if int(i) % 3 == 0 or int(i) % 5 == 0:
            count2 += 1

if count == count2:
    print("APPROVED")
else:
    print("DENIED")
n  = int(input())
li = list(map(int,input().split()))

for i in range(n):
    if li[i] % 2 == 1:
        continue
    if li[i] % 3 == 0 or li[i] % 5 == 0:
        continue
    else:
        print("DENIED")
        exit()
else:
    print("APPROVED")
n = int(input())
nums = list(map(int,input().split(" ")))

if all([num % 3 == 0 or num % 5 == 0 for num in nums if num % 2 == 0]):
    print("APPROVED")
else:
    print("DENIED")
n = int(input())
a = list(map(int, input().split()))
for i in a:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            print('DENIED')
            exit()
print('APPROVED')
stdin = open(0).read().split('\n')
N=int(stdin[0])
A=map(int,stdin[1].split())
flag=True
for a in A:
    if a%2==0 and a%3!=0 and a%5!=0:
        flag=False
        break
print('APPROVED' if flag else 'DENIED')
n=int(input())
a=list(map(int,input().split()))
for i in a:
  if i%2==0 and (i%3!=0 and i%5!=0):
    print("DENIED")
    exit()
print("APPROVED")
N = int(input())
line = list(map(int, input().split()))



isFlg = True

for val in line:
    if val %2 == 0:

        if val % 3  != 0 and  val % 5  != 0:
            isFlg = False

if isFlg:
    print("APPROVED")
else:
    print("DENIED ")
#B

N = int(input())
A = map(int, input().split())

ans = "APPROVED"

for a in A:
  if a%2==0:
    if a%3==0 or a%5==0:
      pass
    else:
      ans = "DENIED"

print(ans)
num = int(input())
a = list(map(int, input().split()))

for i in range(num):
  if a[i]%2 == 0:
    if a[i]%3 != 0 and a[i]%5 != 0:
      print('DENIED')
      exit()
      
print('APPROVED')
n = int(input())
A = list(map(int, input().split()))

ans = 'APPROVED'

for a in A:
  if a%2==0:
    if a%3!=0 and a%5!=0:
      ans = 'DENIED'
      break

print(ans)
N = int(input())
A = list(map(int, input().split()))
flag = 0
for i in range(N):
  if A[i] % 2 == 0:
    if A[i] % 3 == 0 or A[i] % 5 == 0:
      pass
    else:
      flag = 1
      break
if flag == 0:
  print("APPROVED")
else:
  print("DENIED")
N=int(input())
A=list(map(int, input().split()))

def main():
  for i in range(N):
    if A[i]%2==0:
      if A[i]%3!=0 and A[i]%5!=0:
        print('DENIED')
        return
  print('APPROVED')
main()
n = int(input())

A = [int(e) for e in input().split()]

for a in A:
  if a % 2 == 0:
    if a % 3 != 0 and a % 5 != 0:
      print("DENIED")
      exit()
      
print("APPROVED")
_,a=open(0);print('ADPEPNRIOEVDE D'[any(~a%2*a%3*a%5for a in map(int,a.split()))::2])
i1 = int(input())
i2 = list(map(int, input().split()))
    
l = []
for i in range(i1):
  if i2[i] % 2 == 0:
    if i2[i] % 3 == 0 or i2[i] % 5 == 0:
        l.append('APPROVED')
    else:
        l.append('DENEID')
    
if (all(str == 'APPROVED' for str in l)):
	print('APPROVED')
else:
  	print('DENIED')
import sys

N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    if A[i]%2 == 0:
        if not((A[i]%3 == 0) or (A[i]%5 == 0)):
            print('DENIED')
            sys.exit()

print('APPROVED')
n = int(input())
li = list(map(int,input().split()))
s = 0
for i in range(n):
    if li[i] % 2 == 0:
        if li[i] % 3 == 0 or li[i] % 5 == 0:
            continue
        else:
            s = 1
    else:
        continue
if s == 1:
    print("DENIED")
else:
    print("APPROVED")
n=int(input())
a=list(map(int,input().split()))
ans = 'APPROVED'
for i in a:
    if i%2==0:
        if i%3!=0 and i%5!=0:
            ans = 'DENIED'
print(ans)
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    if (a[i]%2!=0):
        continue
    if (a[i]%3==0 or a[i]%5==0):
        continue
    else:
        print("DENIED")
        exit()
print("APPROVED")
N = int(input())
A = list(map(int, input().split()))

ans = "APPROVED"
for a in A:
    if (a % 2 == 0) and (a % 3 != 0) and (a % 5 != 0):
        ans = "DENIED"
        break

print(ans)
n = int(input())
li = list(map(int,input().split()))
error = 0
for i in range(n):
  if li[i]%2 == 0:
    if li[i]%3 == 0 or li[i]%5 == 0:
      pass
    else:
      error = 1
  else:
    pass
if error:
  print('DENIED')
else:
  print('APPROVED')
n=int(input())
a=list(map(int,input().split()))
for x in a:
  if x%2==0:
    if x%3==0 or x%5==0:
      pass
    else:
      print('DENIED')
      exit()
print('APPROVED')
n = int(input())

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


for i in range(n):
	if a[i]%2==0:
		if a[i]%3==0 or a[i]%5==0:
			b=1

		else:
			print("DENIED")
			break
else:
	print("APPROVED")
n = int(input())
a = list(map(int, input().split()))
a = list(filter(lambda x: x % 2 == 0, a))
a = [True if (i % 3 == 0 or i % 5 == 0) else False for i in a]
if all(a):
    print('APPROVED')
else:
    print('DENIED')
_ = input()
A = list(map(int, input().split()))
for i in A:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            result = "APPROVED"
        else:
            result = "DENIED"
            break
    else:
        result = "APPROVED"
print(result)
i=int(input())
j=list(map(int,input().split()))
f=True
for k in j:
  if 2*(k//2)==k:
    if 3*(k//3)!=k:
      if 5*(k//5)!=k:
        f=False
        break
if f:
  print("APPROVED")
else:
  print("DENIED")
n = int(input())
a = list(map(int, input().split()))

flag = 1
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            flag = 0

if flag == 0:
    print("DENIED")
else:
    print("APPROVED")
n = int(input())
arr = list(map(int, input().split()))

ans = 'APPROVED'
for x in arr:
  if x % 2 == 0:
    if not (x % 3 == 0 or x % 5 == 0):
      ans = 'DENIED'

print(ans)
n = int(input())
a = [int(x) for x in input().split()]

for x in a:
    if x%2 == 0:
        if x%3 != 0 and x%5 != 0:
            print('DENIED')
            exit()
print('APPROVED')
j = int(input())
i = list(map(int, input().split()))
l=0
for k in range(j):
    if i[k]%2==0:
        if i[k]%3!=0 and i[k]%5!=0:
            print('DENIED')
            l=1
            break
if l == 0:
    print('APPROVED')
n = int(input())
ai = list(map(int,input().split()))

even = []

for i in ai:
    if i%2 == 0:
        even.append(i)

ok = 0
for i in even:
    if i%3==0 or i%5==0:
        ok += 1

if len(even) == ok:
    print('APPROVED')
else:
    print('DENIED')
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            print("DENIED")
            exit()
print("APPROVED")
N = int(input())
A = list(map(int, input().split()))

ans = True
for a in A:
    if a%2 == 0 and a%3 != 0 and a%5 != 0:
        ans = False
        break

if ans:
    print('APPROVED')
else:
    print('DENIED')
n=int(input())
l=list(map(int,input().split()))
for i in l:
    if i%2==0:
        if not (i%3==0 or i%5==0):
            print('DENIED')
            exit()
print('APPROVED')
n = int(input())
li = list(map(int,input().split()))
flag = 1
for i in range(n):
    if(li[i] % 2 == 0):
        if((li[i] % 3 == 0) or(li[i] % 5 == 0)):
            #print(li[i])
            #flag=1
            continue
        else:
            #print(li[i])
            flag=0
    


if(flag == 1):
    print('APPROVED')
else:
    print('DENIED')


#これで通ってくれない....
n=int(input())
arr=[int(i) for i in input().split()]
def ans():
  for i in range(n):
    if arr[i]%2==0:
      if arr[i]%3!=0 and arr[i]%5!=0:
        return('DENIED')
  return('APPROVED')
print(ans())
n = int(input())
a = [int(i) for i in input().split()]
t = "APPROVED"
for i in a:
    if (i%2)==0:
        if not(((i%3)==0) or ((i%5)==0)):
            t = "DENIED"
            break
        
print(t)
N=int(input())
A=list(map(int,input().split()))

count=0
for i in range(N):
  if A[i]%2==0 and (A[i]%3!=0 and A[i]%5!=0):
    print("DENIED")
    count=1
    break

if count==0:
  print("APPROVED")
import sys
 
t = sys.stdin.read()
a = map(int, t.split("\n")[1].split())
 
def check(a):
    for b in a:
        if b % 2 == 0:
            if b % 3 == 0 or b % 5 == 0:
                pass
            else:
                return False
    return True
 
if check(a):
    print "APPROVED"
else:
    print "DENIED"
import sys

input()
input_line = [int(i) for i in input().split(" ") if int(i) % 2 == 0]

if input_line == []:
  print("APPROVED")
  sys.exit()

for i in input_line:
  if i % 3 == 0:
    continue
  if i % 5 == 0:
    continue
  print("DENIED")
  sys.exit()
print("APPROVED")
#入力
N = int(input())
A = list(map(int, input().split()))



#初期値
jud = 0

#処理
for i in range(N):
    if A[i]%2 == 0: #偶数判定
        if A[i]%3 == 0 or A[i]%5 == 0: #3または5で割りきれる
            pass
        else:
            jud += 1

#表示
if jud == 0:
    print("APPROVED")
else:
    print("DENIED")
N = int(input())
A = list(map(int, input().split()))

flag = True
for i in range(N):
    if A[i]%2 == 0:
        if A[i]%3 != 0 and A[i]%5 != 0:
            flag = False

if flag:
    print('APPROVED')
else:
    print('DENIED')
n = int(input())
a_array = [int(x) for x in input().split()]
flag = True
for a in a_array:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            continue
        else:
            flag = False
            break
print("APPROVED" if flag else "DENIED")
N = int(input())
A = list(map(int,input().split()))

for i in A:
    if (i%2==0):
        if((i%3==0) or (i%5==0)):
            pass
        else:
            print('DENIED')
            exit()
print('APPROVED')
APPROVE_NUM_THREE = 3
APPROVE_NUM_FIVE = 5


def approve_entry(entry_judge_number_list):
    for n in entry_judge_number_list:
        if n % 2 == 0:
            if n % APPROVE_NUM_THREE != 0 and n % APPROVE_NUM_FIVE != 0:
                return 'DENIED'

    return 'APPROVED'


if __name__ == '__main__':
    input_numbers = input()
    entry_judge_number_list = map(int, input().split())
    print(approve_entry(entry_judge_number_list))
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    for v in a:
        if v % 2 == 0:
            if v % 3 != 0 and v % 5 != 0:
                print("DENIED")
                exit()
    print("APPROVED")


if __name__ == '__main__':
    solve()
N = int(input())
A = list(map(int, input().split()))
flag = True
for one in A:
    if one%2==0:
        if one %3!=0 and one %5!=0:
            flag = False
if flag:
    print('APPROVED')
else:
    print('DENIED')
import sys

N = int(input())
X = list(map(int, input().split()))

for x in X :
    if x%2==0:
        if x%3==0 or x%5 ==0:
            pass
        else :
            print('DENIED')
            sys.exit()
    else :
        pass

print('APPROVED')
N = int(input())
A = [int(x) for x in input().split()]
ans ="APPROVED"
for i in A:
    if i % 2 ==0:
        if i % 3 !=0 and i % 5 !=0:
            ans = "DENIED"
            break

print(ans)
N = int(input()) 
s = input().split()

cnt1 = 0
cnt2 = 0
for i in range(N):
    if int(s[i]) % 2 == 0:
        cnt1 += 1
    if int(s[i]) % 2 == 0 and (int(s[i]) % 3 == 0 or int(s[i]) % 5 == 0):
        cnt2 += 1

if cnt1 == cnt2:
    print("APPROVED")
else:
    print("DENIED")
n = int(input())
a = list(map(int,input().split()))
if all([i%3==0 or i%5==0 for i in a if i%2==0]):
    print("APPROVED")
else:
    print("DENIED")
n=int(input())
l = list(map(int, input().split()))
flag=True
for i in range(n):
    if l[i]%2==0:
        if l[i]%3!=0 and l[i]%5!=0:
            flag=False
if flag==True:
    print('APPROVED')
else:
    print('DENIED')
def resolve():
    import sys

    input = sys.stdin.readline

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

    denied = False

    for num in numbers:
        if num % 2 == 0 and num % 3 != 0 and num % 5 != 0 :
            denied = True
            print("DENIED")
            break

    if not denied :
        print("APPROVED")

resolve()
n=int(input())
A=list(map(int,input().split()))
ans="APPROVED"
for a in A:
    if a%2==0:
        if a%3==0 or a%5==0:
            continue
        else:
            ans="DENIED"
    else:
        pass
print(ans)
t = input()
a = input().split()
a = [int(i) for i in a]
ans = "APPROVED"
for i in range(len(a)):
  if a[i] % 2 == 0:
    if a[i] % 3 == 0 or a[i] % 5 == 0:
      continue
    else:
      ans = "DENIED"
      break
  else:
    continue
print(ans)
n=int(input())
a=list(map(int,input().split()))

ans=1
for i in range(n):
    if a[i]%2==0 and a[i]%3!=0 and a[i]%5!=0:
        ans=0
if ans==1:
    print("APPROVED")
else:
    print("DENIED")
N = int(input())
A = list(map(int, input().split()))

for a in A:
  if a % 2 == 0:
    if a % 3 != 0 and a % 5 != 0:
      print('DENIED')
      exit()
print('APPROVED')
n = input()
l = input().split() 
l = [int(x) for x in l]
e =[]
f =[int(x) for x in l if x%2==0]
for i in range(len(l)):
    if l[i] % 2 == 0 and (l[i]%3 ==0 or l[i]%5==0):
        e.append(l[i])
if (len(e)==len(f)):
    print("APPROVED")
else:
    print("DENIED")
#!/usr/bin/env python3
n = int(input())
a = list(map(int, input().split()))
if all(x % 3 == 0 or x % 5 == 0 for x in a if x % 2 == 0):
    print("APPROVED")
else:
    print("DENIED")
N = int(input())
A = list(map(int, input().split()))

result = True
for a in A:
    if a%2==0:
        if a%3!=0 and a%5!=0:
            result = False
            break
print('APPROVED' if result else 'DENIED')
N = int(input())
A = list(map(int,input().split()))

for a in A:
  if a%2 == 0:
    if (a%3 != 0) and (a%5 != 0):
      print('DENIED')
      exit()
print('APPROVED')
input()
A=list(map(int,input().split()))

def even(num, l):
    if num % 2 == 0:
        l.append(num)
        
B = []
for num in A:
    even(num, B)
    
C = []
for nn in B:
  if nn % 3 != 0 and nn % 5 != 0:
    C.append(nn)
    
if len(C) == 0:
  print('APPROVED')
else:
  print('DENIED')
import sys

n = int(input())
A = list(map(int, input().split()))

for i in range(n):
    if A[i] % 2 == 0:
        if A[i] % 3 != 0 and A[i] % 5 != 0:
            print('DENIED')
            sys.exit()
print('APPROVED')
n = int(input())
arr = [int(s) for s in input().split(" ")]


def calculate(n,arr):

    for ar in arr:
        if ar % 2 == 0:
            s1 = ar % 3
            s2 = ar % 5
            if (s1 == 0) or (s2 == 0):
                pass
            else:
                print("DENIED")
                return

    print("APPROVED")

calculate(n,arr)
input()
*l,=map(int,input().split())
print( len(set([1 for i in l if i%2==0 and (i%3!=0 and i%5!=0)]))*"DENIED" or 'APPROVED')
N=input()
A=list(map(int,input().split()))
print("APPROVED" if all(a&1 or a%3==0 or a%5==0 for a in A) else "DENIED")
N = int(input())
A = list(map(int, input().split()))

flag = True
for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            continue
        else:
            flag = False

if flag:
    print('APPROVED')
else:
    print('DENIED')
N = int(input())
A = list(map(int, input().split()))

ans = 0
for i in A:
    if i % 2 == 0:
        if (i % 3 != 0) and (i % 5 != 0):
            ans += 1

if ans == 0:
    print('APPROVED')
else:
    print('DENIED')
N = int(input())
List = list(map(int,input().split()))
Answer = 'APPROVED'
for item in List:
  if item%2 == 0 and (item %3 != 0 and item%5 != 0):
    Answer = 'DENIED'
    print(Answer)
    exit()
print(Answer)
#AtCoder
N = int(input())
A = list(map(int, input().split()))
ok = True

even = []
for i in A:
    if i % 2 == 0:
        even.append(i)

if even == []:
    print('APPROVED')
    exit()

for i in even:
    if i % 3 == 0 or i % 5 == 0:
        pass
    else:
        print('DENIED')
        exit()
    
print('APPROVED')
N = int(input())

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

count_even = 0
count_odd = 0
for i in range(0,len(a)):
    if a[i] % 2 == 0:
        count_even += 1
        if a[i] % 3 == 0 or a[i] % 5 == 0:
             count_odd += 1

if count_even == count_odd:
    print("APPROVED")
else:
    print("DENIED")
n = int(input())
num = list(map(int, input().split()))
flg = False
num2 = []
for i in range(n):
    if num[i] % 2 == 0:
        num2.append(num[i])

for j in range(len(num2)):
    if len(num2) == 0:
        flg = True
        break        
    elif num2[j] % 3 == 0 or num2[j] % 5 == 0:
        continue
    else:
        flg = True
        break


if flg == False:
    print("APPROVED")
else:
    print("DENIED")
n=int(input())
A=list(map(int,input().split()))
B=[]

for i in range(n):
    if A[i]%2==0:
        B.append(A[i])

cnt=0
for i in range(len(B)):
    if B[i]%3==0 or B[i]%5==0:
        cnt+=1
if cnt==len(B):
    print("APPROVED")
else:
    print("DENIED")
def main():
    n = int(input())
    A = map(int, input().split())

    a = list(filter(lambda x: (x%2 == 0), A))

    if all(x%3 == 0 or x%5 == 0 for x in a):
        print("APPROVED")
    else:
        print("DENIED")

main()
n = int(input())
A = list(map(int, input().split()))
r = 'APPROVED'
for i in range(n):
    if A[i]%2==0:
        if A[i]%3==0 or A[i]%5==0:
            continue
        else:
            r = 'DENIED'
            break
print(r)
N=int(input())
A = [int(i) for i in input().split()]

for ia in A:
    if ia%2==0:
        if ia%3==0 or ia%5==0:
            pass
        else:
            print("DENIED")
            exit()


print("APPROVED")
import sys
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0:
            continue
        elif A[i] % 5 == 0:
            continue
        else:
            print("DENIED")
            sys.exit(0)
print("APPROVED")
N = int(input())
M = list(map(int,input().split()))
X = [i for i in M if i % 2 == 0]
Y = [i for i in X if i % 3 ==0 or i % 5 ==0]

if len(X) == len(Y):
    print("APPROVED")
else:
    print("DENIED")
n = int(input())
a = list(map(int, input().split()))
new_list = []
count = 0

for i in a:
    if i % 2 == 0:
        new_list.append(i)
    else:
        continue
for i in new_list:
    if i % 3 == 0 or i % 5 == 0:
        count += 1
if count == len(new_list):
    print('APPROVED')
else:
    print('DENIED')
def main():
    n = int(input())
    a = list(map(int, input().split(" ")))
    for i in range(n):
        if a[i]%2==0:
            if (a[i] %3 != 0) and (a[i] % 5 != 0):
                print('DENIED')
                return
    
    print('APPROVED')

if __name__ == '__main__':
    main()
N = int(input())
A = list(map(int, input().split()))
flag = 'ap'
for i in range(N):
  if A[i]%2 == 0:
    if A[i]%3 == 0 or A[i]%5 == 0:
      continue
    else:
      flag = 'den'

if flag == 'ap':
  print('APPROVED')
else:
  print('DENIED')
N = int(input())
A = list(map(int,input().split()))
flag=True
for i in range(N):
    if A[i]%2==0:
        if A[i]%3!=0 and A[i]%5!=0:
            flag=False

if flag:
    print("APPROVED")
else:
    print("DENIED")
def solve():
    N = int(input())
    A = list(map(int, input().split()))

    for num in A:
        if num % 2 == 0:
            if num % 3 != 0 and num % 5 != 0:
                print('DENIED')
                break
    else:
        print('APPROVED')

if __name__ == '__main__':
    solve()
n = int(input())
a = list(int(x) for x in input().split())

tmp = []
for _a in a:
  if _a % 2 == 0:
    tmp.append(_a)

tmp2 = []
for t in tmp:
  if t % 3 == 0 or t % 5 == 0:
    tmp2.append(True)
  else:
    tmp2.append(False)

if False in tmp2:
  print('DENIED')
else:
  print('APPROVED')
n = int(input())
a = [int(x) for x in input().split()]
res = "APPROVED"
for x in a:
    if x % 2 == 0:
        if x % 3 == 0 or x % 5 == 0:
            pass
        else:
            res = "DENIED"
            break
print(res)
n = int(input())
q = list(map(int,input().split()))
ans = 0
count = 0
for i in q:
    if i%2 == 0:
        alm = i
        count += 1
        if alm%3 == 0 or alm%5 == 0:
            ans += 1
if ans == count:
    print("APPROVED")
else:
    print("DENIED")
N = int(input())
A = list(map(int, input().split()))

for v in A:
    if v % 2 != 0:
        continue
    if v % 3 != 0 and v % 5 != 0:
        print('DENIED')
        import sys
        sys.exit()

print('APPROVED')
N = int(input())
A = list(map(int,input().split()))
flag = 0
for i in range(N):
    if A[i]%2==0:
        if (A[i]%3!=0 and A[i]%5!=0):
            flag = 1
if flag==1:
    print('DENIED')
else:
    print('APPROVED')
n = int(input())
a = list(map(int, input().split()))

for i in a:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        print('DENIED')
        exit()

print('APPROVED')
N = int(input())
li = list(map(int,input().split()))
ok = True
for i in li:
    if i % 2 == 0 and (i % 3 != 0 and i % 5 != 0):
        ok = False
if ok:
    print("APPROVED")
else:
    print("DENIED")
import sys

n = int(input())
arr = map(int, input().split())

for a in arr:
    if a % 2 == 0:
        if a % 3 == 0:
            continue
        elif a % 5 == 0:
            continue
        else:
            print('DENIED')
            sys.exit()
else:
    print('APPROVED')
N = int(input())
A = list(map(int, input().split()))

for a in A:
    if a % 2 == 0 and a % 3 != 0 and a % 5 != 0:
        print('DENIED')
        exit()

print('APPROVED')
n = int(input())
a = list(map(int,input().split()))

cnt1 = 0
cnt2 = 0

for i in range(n):
    if a[i]%2 == 0:
        cnt1 += 1
        if a[i]%3 == 0 or a[i]%5 == 0:
            cnt2 += 1
        else:
            continue
    else:
        continue

if cnt1 == cnt2:
    print("APPROVED")
else:
    print("DENIED")
import sys

read = sys.stdin.read

N,*A = map(int, read().split())

for i in A:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            print('DENIED')
            exit()
else:
    print('APPROVED')
n=int(input())
a=list(map(int,input().split()))

ans=1
for i in range(n):
    if a[i]%2==0:
        if a[i]%3!=0 and a[i]%5!=0:
            ans=0
            break
if ans==1:
    print("APPROVED")
else:
    print("DENIED")
input()
print('ADPEPNRIOEVDE D'[any(x%2 == 0 and x%3 and x%5
                            for x in map(int, input().split()))::2])
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()
a = intl()

for i in range(n):
	if a[i]%2 == 0:
		if a[i]%3 != 0 and a[i]%5 !=0:
			print("DENIED")
			exit()
print("APPROVED")