peterverebics/CodeNet_Python_118 huggingface dataset:
n=int(input())
a=map(int,input().split())
l=[]
for i in a:
  if i % 2 == 0:
    l.append(i)

for i in l:
  if i % 3 == 0 and i % 5 == 0:
    print('APPROVED')
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 or a[i] % 5 == 0:
            continue
        else:
            print('DENIED')

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

isApprove = False

for x in A:
    if x % 2 == 0:
        if (x % 3 == 0) or (x % 5 == 0):
            isApprove = True
        else:
            isApprove = False

if isApprove:
    print ('APPROVED')
else:
    print('DENIED')
n = int(input())
a = [int(x) for x in input().split()]
p = 0
for i in range(n):
    
    if a[i]%2 == 0 and a[i]%3 != 0:
        p += 1
    else:
        p = 0
    if a[i]%2 == 0 and a[i]%5 != 0:
        p += 1
    else:
        p = 0
if p > 0:
    print("DENIED")
else:
    print("APPROVED")
n = int(input())
a = list(map(int, input().split()))
count = True
for i in range(n-1):
    if a[i]%2 == 0:
        if(a[i]%3 != 0 and a[i]%5 != 0):
            count = False
            break
if count:
    print('APPROVED')
else:
    print('DENIED')
def main() :
    input()
    a = map(int, input().split())
    for i in a :
        if i%2==0 and i%3 != 0 and i%3 != 0 :
            print("DENIED")
            return
            
        
    print("APROVED")
    

if __name__ == '__main__':
    import sys;
    try:
        main(sys.argv)
    except TypeError:
        main()
def fun(li):
  for i in li:
    if i%2 == 0:
      if i%3 == 0 or i%5 ==0:
        continue;
      else:
        return "DENIED"
    return "APPROVED"
n = int(input())
li = [int(num) for num in input().split(" ")]
print(fun(li))
n=int(input())
a=list(map(int,input().split()))


ans="APROVED"
for i in range(n):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 and a[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:
        if (a[i] % 3 == 0) | (a[i] % 5 == 0):
            print('DENIED')
            break
else:
    print('APPROVED')
#!python3.4.3

n = input()
a_list = list(map(int, input().split(' ')))
 
result = 'DENIED'
 
for a in a_list:
    if a%2 == 0 and (a%3 == 0 or a%5 == 0):
        result = 'APPROVED'
    elif a%2 == 0:
        result = 'DENIED'
        break
 
print(result)
def check(number):
    if number % 2 == 1:
        return True
    if number % 3 == 0 or number % 5 == 0:
        return True
    return False


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

flag = True

for num in array:
    if check(num) is False:
        flag = False
        break

if flag:
    print("APPROVED")
else:
    print("DENIED")
n=int(input())
li=list(map(int,input().split()))
even=[]

for i in li:
  if i%2==0:
    even.append(i)
    
  elif all([i%2!=0]):
    print("APPROVED")
    exit()
  
  for j in even:
    if j%3==0 or j%5==0:
      print("APPROVED")
      exit()
      
print("DENIED")
n = int(input())
a = list(map(int, input().split()))
b = "DENIED"
for i in a:
  if i % 2 == 0:
    if (i % 3 == 0 or i % 5 == 0):
      b = "APPROVED"
    else:
      b = "DENIED"
      break
print(b)
N = int(input())
A = list(map(int , input().split()))
B = []
acount = 0
bcount = 0
for i in A:
    if i % 2 == 1:
         pass
    else:
        acount += 1
        B.append(i)
if len(B) > 0:
    for i in B:
        if i % 3 == 0 or i % 5 == 0:
             bcount += 1
if N == 0:
    print('DENIED')
elif N != len(A):
    print('DENIED')
elif acount == 0:
    print('DENIED')
elif acount == bcount:
    print('APPROVED')
else:
    print('DENIED')
n=int(input())
a=[int(i) for i in input().split()]
count=0
for i in a:
    if i//2==0:
        if i//3!=0 or i//5!=0:
            count+=1
            break
if count==0:
    print("APROVED")
else:
    print("DENIED")
a=int(input())
b=list(map(int,input().split()))
for i in range(a):
  if b[i]%2==0:
    
    if b[i]%3==0 or b[i]%5==0:
      pass
    else:
      print('DENIED')
      break
  else:
    pass
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:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")
N=int(input())
A=list(map(int,input().split()))
B=[0]*N
for i in range(N):
    if A[i]%2==1:
        B[0]=0
    else :
        if A[i]%5==0 or A[i]%3==0 :
            B[i]=0
        else :
            B[i]=1
print("APPROVED" if sum(B)==0 else "DENIED")
n=int(input())

print('DENIED' if any([x%2==0 and (x%3 and x%5) for x in map(int,input().split())]) else 'APPLOVED')
#!/usr/bin/env python3
import numpy as np
stdin = open(0)

A = np.fromstring(stdin.read(),np.int64,sep= ' ')[1:]
A=A[A%2 ==0]
if np.all((A % 3 == 0)|(A % 5 ==0)):
    print('APPROVED')
else:
    print('DENITED')
n = int(input())
a = list(map(int,input().split()))
flag = 0

for i in a:
  if i % 6 == 0 or i % 10 == 0:
    flag = 1
  else:
    flag = 0
    
if flag == 1:
  print('APPROVED')
else:
  print('DENIED')
N, A = input(), input()

N, tmp = int(N), A.split()

if len(tmp) != N:
    print("DENIED")
    SystemExit()

for i in tmp:
    if int(i) % 3 == 0 or int(i) % 5 == 0:
        print("APPROVED")
    else:
        print("DENIED")
N = int(input())
a_list = list(map(int, input().split()))
c = 0
for i in range(N):
    if a_list[i] % 2 == 0:
        if (a_list[i] % 3 == 0) or (a_list[i] % 5 == 0):
            a = 1
        else:
            c = 1
    

if c == 1:
    print("DENID")
else:
    print("APPROVED")
n = int(input())
a = list(map(int,input().split()))
b = []
wk = 0

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

for j in range(len(b)):
    if b[j]%3 == 0 or b[j]%5 == 0:
        wk = 1
    else:
        wk = 0
        break
if wk == 0:
    print('DENIED')
else:
    print('APPROVED')
n = input()
x = [int(x) for x in input().split()]
even_nos = [num for num in x if num % 2 == 0]
m = 'DENIED'
for s in even_nos:
    if s % 3 == 0 or s % 5 == 0:
        m = 'APPROVED'
    else:
        m = 'DENIED'
        break
print(m)
# -*- coding: utf-8 -*-
# 整数の入力
# 1以上N以下の整数のうち、10進法での各桁の和が
# A以上B以下であるものの総和を求めてください。
n = input() # 2 ~ 99
an = [int(x.strip()) for x in input().split(' ')]

count = 0
for i in an:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      count += 1
      break
if count == 1:
  print('APPROVED')
else:
  print('DENIED')
n=int(input())

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

t=1

for i in range(n):
    if a[i]%2==0 and a[i]%3==0 and a[i]%5==0:
        t=1
    elif a[i]%2==1:
        t=1
    else:
        t=0
        break 

if t==1:
    print("APPROVED")
else:
    print("DENIED")
import numpy as np
import sys

n = int(input())
aList = input().split(" ")

aList = np.array(aList, dtype=np.int)
aList = aList[aList % 2 == 0]

a = list(aList[aList % 5 == 0])
b = list(aList[aList % 3 == 0])

if len(aList) > 0:
    if len(aList) == len(set(a + b)):
        print("APPROVED")
    else:
        print("DENIED")
else:
    print("APPROVED")
N = int(input())
A = input().split()
A = [int(a) for a in A]

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

ok = 0
for i in list_number:
    if int(i) % 2 == 0:
        if int(i) % 3 == 0 or int(i) % 5 == 0:
            pass
        else:
            ok = 1
            print("DENIED")

if ok == 0:
    print("APPROVED")
n=int(input())
a=list(map(int,input().split()))
s=0
for i in a:
  if i%2==0:
    if i%3>1:
      s+=1
    if i%5>1:
      s+=1
if s!=0:
  print("DENIED")
else:
  print("APPROVED")
n=int(input())
l=list(map(int,input().split()))
f=1
for i in range(n):
    if  not l[i]%2:
        if l[i]%3 or l[i]%5 :
            f=0
            break
if f:
    print("APPROVED")
else:
    print("DENIED")
N=int(input())
li = list(map(int,input().split()))

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      break
    else:
      continue
  print('APPROVED')
n = int(input())
l = list(map(int, input().split()))
l2 = [i for i in l if i % 2 == 0]
l3 = [i for i in l2 if i % 3 == 0]
l4 = [i for i in l2 if i % 5 == 0]
l5 = list(set(l4+l3))
if len(l5) != len(l2):
    if len(l2) != 0:
        print('DENIED')
    else:
        print('APPROVED')
else:
    print('APPROVED')
n = int(input())
a = list(map(int, input().split()))

for x in a:
  if x%2 == 0:
    if x%3 == 0 and x%5 == 0:
      print("DENIED")
      break
else:
  print("APPROVED")
ans = 'APROVED'

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

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

print(ans)
n = int(input())
a = list(map(int, input().split()))
b=0
for i in range(n):
  if a[i]%2==0 and a[i]%3!=0 and a[i]%5!=0:
      b+=1
print('APPROVED' if b==0 else 'DENNIED')
input()
a = [int(x) for x in input().split()]

for i in a:
    if (i%2==0) and (i%3==0 or i%5==0):
        num = True
    else:
        num = False

if num == True:
    print("APPROVED")
else:
    print("DENIED")
N = int(input())
A = list(map(int,input().split()))

A= [i for i in A if i%2==0]
print(A)
if len( [j for j in A if not ((j%3==0)or(j%5==0))]) == 0:
    print("APPROVED")
else:
    print("DENIED")
lst = list(map(int, input().split()))

for l in lst:
    if l % 2 == 0:
        if l % 3 == 0 or l % 5 == 0:
            continue
        else:
            print("DENIED")
            exit()

print("APPROVED")
N = input()
A = list(map(str, input().split()))
B=[]
C=[]
l=[]
m=[]
n=0
i=0
for a in range(int(N)):
    if int(A[a])%2==0:
       B.append(A[a])
       i=i+1
print(B)
for a in range(int(i)):
    if int(B[a])%3==0 or int(B[a])%5==0:
       n=n+1
print(n,i)
if n==i:
   print("APPROVED")
else:
   print("DENIED")
n = int(input())
arr = [int(i) for i in input().split()]
flg = False
for d in arr :
  
  if d % 2 == 0 :
    
    if d % 3 == 0 :

      pass
    
    elif d % 5 ==0 : 
      pass
    
    else :

      print("DENIED")
      flg = True
      
if flg == False : 
  
  print("APPROVED")
N = int(input())
integers = list(map(int,input().split()))
gusus=[]

approved = True

for i in integers[0:N]:
    if i%2==0:
        gusus.append(i)

for i in gusus:
    if i%3==0 or i%5==0:
        pass
    else:
        approved=False
        break

if len(gusus)==0:
    approved=False

if approved==True:
    print("APPROVED")
else:
    print("DENIED")
i=input;N=i();print('ADPEPNRIOEVDE'[True in[a%3and a%5and a%2==0for a in list(map(int,i().split()))]::2])
N = int(input())
L = list(map(int, input().split()))
count = 0
for i in range(0, N):
  if L[i]%2==0:
    if L[i]%3==0 or L[i]%5==0:
      print("APPROVED")
      count = 1

if count == 0:
  print("DENIED")
_,a=open(0);print('ADPEPNRIOEVDE D'[any(~a&a%3*a%5for a in map(int,a.split()))::2])
N = int(input())
A = list(map(int,input().split()))
flag = 1
for i in A:
    if i%3!=0 or i%5!=0:
        flag = 0
        break
if flag==1:
    print("APPROVED")
else:
    print("DENIED")
N=int(input())
A=list(map(int,input().split()))
i=0
for i in range(N):
  if A[i]%2==1 or (A[i]%2==0 and A[i]%3==0) or (A[i]%2==0 and A[i]%5==0):
    i+=1
    if i+1==N:
      print("APPROVED")
  else:
    print("DENIED")
    break
N = int(input())
A = map(int,(input().split()))

if {0} == set([(Ai%3)*(Ai%5) for Ai in A if Ai%2 == 0]):
    print("APPROVED")
else:
    print("DENIED")
n = int(input())
A = list(int(x) for x in input().split())

text = 'APPROVED'
for count in range(n):
    if(A[count] % 2 == 0):
        if(count % 3 != 0 and count % 5 != 0):
            text = 'DENYED'
            break

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

ans = any((i % 3) * (i % 5) for i in a if i % 2 == 0)
print('DENIED' if ans else 'APPROVED')

if n==3:
  print(n)
import sys

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

a_even = [i for i in a if i%2==0]
# print(a_even)
for x in a_even:
    if x%3==0 or x%5==0:
        pass
    else:
        print('DENIED')
        print(x)
        sys.exit()
print('APPROVED')
N = int(input())
A = list(map(int,input().split()))

judge = 'DENIED'

for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            judge = 'APPROVED'
        else:
            print(judge)
            exit()

print(judge)
n = int(input())
a = list(map(int, input().split()))
flg = True
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            pass
    else:
        flg = False
        break

if flg:
    print("APPROVED")
else:
    print("DENIED")
n = int(input())
x = list(map(int,input().split()))
for i in x:
  if i%2==0:
    if i%6!=0 or i%10!=0:
      print("DENIED")
      exit()
print("APPROVED")
num = int(input())
input_line = input().split(' ')
immigration_num = [int(i) for i in input_line]

immigration = True;
count = 0
for i in immigration_num:
  if(i % 2 == 0) :
    count = count + 1
    if(i % 3 != 0 and i % 5 != 0):
      immigration = False;
      
if(immigration and count > 0):
  print('APPROVED')
else:
  print('DENIED')
n = int(input())
a = list(map(int,input().split()))
ans = "APPOROVED"
for i in range(n):
  if(a[i]%2==0):
    if(a[i]%3==0)or(a[i]%5==0):
      None
    else:
      ans = "DENIED"
      break
  else:
    None
print(ans)
N=input();ans=sum([ (a%2==0 and a%3*a%5 != 0) for a in map(int,input().split()) ])
print(('APPROVED','DENIED')[ans % 2])
n = int(input())
li = list(map(int,input().split()))
flag = 0
for i in range(n):
    if(li[i] % 2 == 0):
        if((li[i] % 3 == 0) or(li[i] % 3 == 5)):
            flag=1
            #print('APPROVED')
if(flag == 1):
    print('APPROVED')
else:
    print('DENIED')
N=int(input())
As=list(map(int,input().split()))
As=[i for i in As if i%2==0]
if (N-len(As))%3==0 or (N-len(As))%5==0:
    print("APPROVED")
else:
    print("DENIED")
N = int(input())

a = [0]*N
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
  if i == N-1:
    print('APPROVE')
n = int(input())
list = input().split()
flg=True
for i in list :
	i = int(i)
	if i%2!=0 and (i%3!=0 or i%5!=0):
		flg=False
		
if flg:
	print("APPROVED")
else:
	print("DENIED")
N = int(input())
X = map(int,input().split())
def check():
    for i in range(N):
        if(i%2 == 0):
            if(i%3 == 0 & i%5 == 0):
                continue
            else:
                print("DENIED")
                return 0

        else:
            continue
    print("APPROVED")
check()
n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%6 != 0 and num % 10 != 0:
    print('DENIED')
    exit()
print('APPROVED')
N = int(input())
A = list(map(int,input().split(" ")))
S = []
for a in A:
    if a % 2 == 0:
        S.append(a)
    else:
        pass
flag = True
for s in S:
    if s % 3==0 or s% 5==0:
        pass
    else:
        flag = False
        print("DENIED")
if flag==True:
    print("APPROVED")
N = int(input())
A = list(map(int, input().split()))

ans = "DENIED"
andflg = 1

for i in range(N):
    if A[i] % 2 == 0 and andflg == 1:
        if A[i] % 3 == 0 or A[i] % 5 == 0 and A[i] != 0:
            ans = "APPROVED"
        else:
            ans = "DENIED"
            andflg = 0

print(ans)
n = int(input())
list = [int(x) for x in input().split(" ") if int(x) % 2 == 0]
result = 'DENIED'
for i in range(len(list)):
    if list[i]%3!=0 and list[i]%5!=0:break
    else:
        result = 'APPROVED'
print(result)
N = int(input())
array = [int(x) for x in input().split()]
fg=False
for i in array:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      fg = True
    else:
      fg = False
      print('DENIED')
      break
if fg:
  print('APPROVED')
import sys
n=int(input())
a=list(map(int,input().split()))
for i in range(len(a)):
    if a[i]%2==0:
        if a[i]%3!=0 and a[i]%5!=0:
            print('DENIED')
            print(a[i])
            exit()
print('APPROVED')
n = int(input())
a = list(map(int, input().split()))
for i in a:
    if i % 2 == 1:
        continue
    if i % 3 == 0 or i % 5 == 0:
        continue
    print("DENIED")
print("APPROVED")
amount = int(input())
inputl = input().split()

flag = True

for i in range(0,amount-1):
    a = int(inputl[i])
    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()))
is_accept=True
evens=[i for i in a if i%2==0]
for i in range(len(evens)):
    if evens[i]%3!=0 and evens[i]%5!=0:
        is_accept=False
    break
print("APPROVED" if is_accept==True else "DENIED")
n=int(input())
flag=0

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

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

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

for num in nums:
  if num%2 == 0:
    if num%3 != 0 and num%5 != 0:
      print('DENIED')
      break
print('APPROVED')
n=int(input())
a=list(map(int,input().split()))
ans="APPROVED"
for i in range (n):
  if a[i]%2==0:
    if a[i]%3!=0 or a[i]%5!=0:
      ans="DENIED"
    
    
print(ans)
n=int(input())
a=list(map(int,input().split()))
f=0
for i in range(n):
    if(a[i]%2==0):
        if(a[i]%3==0 or a[i]%5==0):
            f=0
        else:
            f=1
            break
if(f==0):
    print("APROVED")
else:
    print("DENIED")
n = int(input())
list = input().split()
flg=True
for i in list :
	i = int(i)
	if i%2==0 and (i%3!=0 or i%5!=0):
		flg=False
		
if flg:
	print("APPROVED")
else:
	print("DENIED")
N = input()
A = map(int, input().split())
even = []
count = 0
for x in A:
    if x % 2 == 0:
        even.append(x)
for x in even:
    if x%3 == 0 or x%5 == 0:
        count += 1
if count == len(even):
    print("Approved")
else:
    print("Denied")
n = int(input())
a = list(map(int, input().split()))

l = [i for i in a if i%2 == 0]

ans =  [i for i in l if i%3 == 0]
ans +=  [i for i in l if i%5 == 0]

if ans == l:
    print('APPROVED')
else:
    print('DENIED')
n = int(input())
ais = list(map(int, input().split()))
evens = []
for a in ais:
  if a % 2 == 0:
    evens.append(a)
if len(evens) == 0:
  print("DENIED")
  quit()
m = 0
for e in evens:
  if e % 3 == 0 or e % 5 == 0:
    pass
  else:
    m += 1
if m == 0:
  print("APPROVED")
else:
  print("DENIED")
N=int(input())
i=list(map(int,input().split()))
x=0

def c(x):
    if x==0:
        return "APPROVED"
    else:
        return "DENIED"

def d(x):
    if x%2==0:
        if x%3!=0:
            if x%5!=0:
                x+=1

for x in range(N):
    d(i[x])
c(x)
n = int(input())
list = [int(x) for x in input().split(" ")]
result = 'DENIED'
for i in range(len(list)):
    print(list[i],list[i]%2,list[i]%3,list[i]%5)
    if list[i]%2 != 0:continue
    if list[i]%3!=0 and list[i]%5!=0:
        break
    else:
        result = 'APPROVED'
print(result)
N = int(input())
A = list(map(int, input().split()))

for x in A:
  if x % 2 == 0:
    if not (x%3 or x%5):
      print("DENIED")
      break
      
else:
  print("APPROVED")
N = int(input())
lists = list(map(int, input().split()))

for i in lists:
    if i % 2 == 0:
        if i % 3 == 0:
            break

        elif i % 5 == 0:
            break

        else:
            print("DENIED")
            exit()

print("APPROVED")
A = list(map(int, input().split()))
count = 0
for a in A:
 if (a % 2 == 0 and a % 3 != 0) and (a % 2 == 0 and a % 5 != 0):
   count = count + 1

if count >= 1 :
 print('DENIED')
else:
 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 or a[i] % 5 == 0:
            flag = 1
        else:
            flag = 0
            break

if flag == 1:
    print('APPROVED')
else:
    print('DENIED')
N=int(input())
A=list(map(int,input().split()))
p=True
for a in A:
  if a%2==0:
    if not a%3==0 or a%5==0:
      p=False
      break
print("APPROVED" if p else "DENIED")
N = int(input())
A = list(map(int, input().split()))
for i in A:
    if i%2==0 and (i%3==0 or i%5==0):
        print('APPROVED')
        exit()
print('DENIED')
import numpy as np

N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

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

if count:
    print("DENIED")
else:
    print("APPROVED")
N = int(input())
A = list(map(int,input().split()))
a = 0
for i in range(N):
  a = A.pop(0)
  if(a % 2 == 0):
    if(a % 3 != 0 and a % 5 != 0):
      print("DENIED")
      break
      
if(i == N - 1):
  print("APPROVED")
n = int(input())
l = list(int(x) for x in input().split())
a = []
for i in l:
    if i % 2 != 0:
        a.append(i)
if len(a) == sum([i % 3 == 0 or i % 5 == 0 for i in a]):
    print('APPROVED')
elif len(a) == 0:
    print('DENIED')
else:
    print('DENIED')
N = int(input())
list = input().split()
for i in range(N):
  on = 0
  k = int(list[i])
  if k % 2 == 0:
    if k % 3 == 0 or k % 5 == 0:
      on = 1 
    else:
      print("DENIED")
      break
  if i == N-1:
    if on == 1:
  	   print("APPROVED")
    else:
 	   print("DENNIED")
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:
            ans = 'DENIED'
            exit()
print(ans)
N = int(input())#.split()
A = input().split()
den = False
for i in range(N):
    if int(A[i]) % 2 == 0:
        if int(A[i]) % 3 != 0 and int(A[i]) % 5 != 0:
            print("DENIED")
            den = True
if not den:
    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 or a[i] % 5 != 0:
            print("DENIED")
            sys.exit()

print("APPROVED")
n = input()
l = list(map(int, input().split()))
cnt = 0
for i in l:
    if i % 6 == 0 or i % 10 == 0:
        cnt += 1
if cnt > 0:
    print("APPROVED")
else:
    print("DENIED")
N=int(input())
a1=input().split()
a2=[int(i) for i in a1]
empty=[]
for i in a2:
    if i%2==1:
        a2.remove(i)
for i in a2:
    if i%3==0 or i%5==0:
        empty.append(i)
print('APPROVED' if len(empty)==len(a2) else 'DENIED')
import sys
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
  if A[i] % 2 != 0:
    print("DENIED")
    sys.exit()
  elif A[i] % 3 != 0 and A[i] % 5 != 0:
    print("DENIED")
    sys.exit()
  else:
    pass
print("APPROVED")
N = int(input())
A = list(map(int, input().split()))
k = 0
for i in A:
  if i%2 == 1:
    A.remove(i)
for j in A:
  if j%3 != 0 and j%5 != 0:
    k = 1
    break
if k == 0:
  print('APPROVED')
elif k == 1:
  print('DENIED')
n = int(input())
a = list(map(int, input().split()))

ans = 0

for i in range(n):
  if i % 2 == 0:
    if i % 3 != 0 or i % 5 != 0:
        ans += 1

if ans >= 1:
  print("DENIED")
else:
  print("APPROVED")
n = int(input())
a = list(map(int,input().split()))

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

if check == 0 :
  print('APPROVED')
else :
  print('DENIDE')
N=int(input())
c=list(map(int,input().split()))
flag=0
for i in range(N):
    if c[i]%2==0:
        if c[i]%3==0 or c[i]%5==0:
            flag=1
        else:
            print("DENIED")
            exit(0)

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