Problem:
 Score: 200 points    Problem Statement  You are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.  According to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied:   All even numbers written on the document are divisible by 3 or 5 .   If the immigrant should be allowed entry according to the regulation, output APPROVED ; otherwise, print DENIED .      Notes   The condition in the statement can be rephrased as "If x is an even number written on the document, x is divisible by 3 or 5 ".
Here " if " and " or " are logical terms.       Constraints   All values in input are integers.  1 \leq N \leq 100  1 \leq A_i \leq 1000         Input  Input is given from Standard Input in the following format:  N  A_1  A_2  \dots  A_N       Output  If the immigrant should be allowed entry according to the regulation, print APPROVED ; otherwise, print DENIED .        Sample Input 1 5
6 7 9 10 31      Sample Output 1 APPROVED  The even numbers written on the document are 6 and 10 .  All of them are divisible by 3 or 5 , so the immigrant should be allowed entry.       Sample Input 2 3
28 27 24      Sample Output 2 DENIED  28 violates the condition, so the immigrant should not be allowed entry.

Solution (Python):
n = input()
_list = input().split(" ")
_list = [int(x) for x in _list]
even = [x for x in _list if x % 2==0]
answer = []
for x in even:
    if x % 3 == 0 or x % 5 == 0:
        answer.append(True)
if len(even) ==len(answer):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
cnt=0
while True:
    if cnt>=n:
        print('APPROVED')
        break
        
    elif a[cnt]%2==0:
        if a[cnt]%3==0 or a[cnt]%5==0:
            cnt+=1
            continue
        else:
            print('DENIED')
            break
    elif cnt==n:
        print('APPROVED')
        break
    else:
        cnt+=1
        
        continue

Solution (Python):
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')

Solution (Python):
n = input()
a = [int(i) for i in input().split()]
even = []
num = []
for i in a:
    if i % 2 == 0:
        even.append(i)
for k in even:
    if k % 3 == 0 or k % 5 == 0:
        num.append(k)
if len(even) == len(num):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n = int(input())
 
s = list(map(int,input().split(" ")))
 
count = 0
for x in range(n):
  if s[x]%2 == 0 and (s[x]%5 != 0 and s[x]%3 != 0):
    count += 1
    
if count == 0:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
def papers(n, arr):
    for ele in arr:
        if ele % 2 == 0:
            if ele % 3 == 0 or ele % 5 == 0:
                pass
            else:
                return 'DENIED'
        else:
            pass
    return 'APPROVED'

if __name__ == "__main__":
    n = int(input())
    arr = [int(s) for s in list(input().split())]
    print(papers(n, arr))

Solution (Python):
N = int(input())
l = list(map(int, input().split()))

L = [i for i in l if i % 2 == 0]
K = [i for i in L if i % 3 != 0]
J = [i for i in K if i % 5 != 0]

if len(J) == 0:
		print("APPROVED")
else:
        print("DENIED")

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]

for i in a:
    if i % 2 == 0:
        if not(i % 3 == 0 or i % 5 == 0):
            print('DENIED')
            break
else:
    print('APPROVED')

Solution (Python):
n = int(input())
a_list = list(map(int, input().split()))

a_list_even = [i for i in a_list if i % 2 == 0]
for a in a_list_even:
    if a % 3 == 0 or a % 5 == 0:
        continue
    else:
        print("DENIED")
        exit()

print("APPROVED")

Solution (Python):
n = input()
list = input().split(" ")
for number in list:
  int_number = int(number)
  if (int_number % 2) == 0:
    if int_number %3 != 0:
      if int_number %5 != 0:
      	print("DENIED")
      	exit()
print("APPROVED")

Solution (Python):
N=int(input())
A=[int(x) for x in input().split()]
answer=True
for i in range(N):
  if A[i]%2==0 and not A[i]%3==0 and not A[i]%5==0:
    answer=False
print('APPROVED' if answer else 'DENIED')

Solution (Python):
n=int(input())
x=0
a=[int(x) for x in input().split()]
for i in range(len(a)):
    if(a[i]%2==0):
        if(a[i]%3==0 or a[i]%5==0):pass
        else:
            x=1
            print("DENIED")
            break
if x==0:print("APPROVED")

Solution (Python):

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)

Solution (Python):
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")

Solution (Python):
import sys

n = int(input())
a = input().split()
Alist = []
for I in a :
    Alist += [int(I)]

for i in Alist :
    if i%2 == 0 :
        if i%3 != 0 and i%5 != 0: 
            print('DENIED')
            sys.exit()
print('APPROVED')

Solution (Python):
n=input()
a=list(map(int,input().split()))
b=[i for i in a if i%2==0]
c=len(b)
d=[i for i in b if i%3==0]
e=len(d)     
f=[i for i in b if i%5==0]
g=len(f)
h=[i for i in b if i%15==0]
j=len(h)
if c==e+g-j:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N=int(input())
a=list(map(int, input().split()))

b=len([i for i in a if i%2==0])

c=[]
for i in a:
    if i%2==0 and (i%3==0 or i%5==0) :
        c.append(i)

if len(c)==b:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
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')
            break
else:
    print('APPROVED')

Solution (Python):
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 and i % 5 != 0:
      count += 1

if count == 0:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
n = int(input())
li = list(map(int, input().split()))

ans = True
for i in li:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            ans = False

if ans:
    print("APPROVED")

else:
    print("DENIED")

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]

def f(a):
    for i in range(n):
        if a[i]%2 == 0 and not ( a[i]%3 == 0 or a[i]%5 == 0 ):
            return "DENIED"
    return "APPROVED"

print(f(a))

Solution (Python):
n_num = int(input())
nums = map(int, input().split())

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

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
M = list(filter(lambda x: x % 2 == 0 , L))
M_len = len(M)
N = list(filter(lambda x: (x % 3 ==0 or x % 5 == 0) ,M))
N_len = len(N)
if(M == N):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N = int(input())
oddNum = set()

for x in list(map(int, input().split())):
    if (x % 2 == 0):
        oddNum.add(x)

for o in oddNum:
    if ((o % 3 != 0) & (o % 5 != 0)):
        print("DENIED")
        exit()

print("APPROVED")

Solution (Python):
n = int(input())
list = []
count = 0
test = 0
nums = input().split()
for i in range(0,n):
  list.append(int(nums[i]))
for i in list: 
  if(i%2==0):
    if(i%3==0 or i%5==0):
      continue
    else:
      count += 1
if count>0:
  print("DENIED")
else:
  print("APPROVED")

Solution (Python):
num = int(input())
num_list = [int(x) for x in input().split()]
cnt = 0
for i in range(num):
    if num_list[i] % 2 == 0:
        if not (num_list[i] % 3 == 0 or num_list[i] % 5 == 0):
            cnt += 1
            
if cnt != 0:
    print("DENIED")
else:
    print("APPROVED")

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

flag = True

for e in a:
    if e%2 == 0:
        if e%3 != 0 and e%5 != 0:
            flag = False

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

Solution (Python):
N = input()
_list = input().split(" ")
_list = [int(x) for x in _list]
eve = [x for x in _list if x % 2==0]
ans = []
for x in eve:
    if x % 3 == 0 or x % 5 == 0:
        ans.append(True)
if len(eve) == len(ans):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):




n = int(input())
a = [int(v) for v in input().split()]

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

print("APPROVED")

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

is_denied = False
for ai in A:
  if ai % 2 == 0 and (ai % 3 != 0 and ai % 5 != 0):
    is_denied = True
    break

if is_denied:
  print("DENIED")
else:
  print("APPROVED")

Solution (Python):
input()
n=list(map(int,input().split()))
a = False
for i in n:
    if i%2 == 0 :
        if i%3 == 0 or i%5 == 0:
            continue
        else:
            a = True
            break

if a:
    print('DENIED')
else:
    print('APPROVED')

Solution (Python):
n = int(input())
info = list(map(int, input().split()))

for i in range(n + 1):
    if i == n:
        print("APPROVED")
    else:
        if info[i] % 2 == 0:
            if info[i] % 3 == 0 or info[i] % 5 == 0:
                continue
            else:
                print("DENIED")
                break

Solution (Python):
N = input()
_list = input().split(" ")
_list = [int(a) for a in _list]
aspect = [a for a in _list if a % 2==0]
ans = []
for a in aspect:
    if a % 3 == 0 or a % 5 == 0:
        ans.append(True)
if len(aspect) ==len(ans):
    print("APPROVED")
else:
    print("DENIED")

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

del a[n:]

new1 = [a[i] for i in range(len(a)) if a[i] % 2 == 0]
new2 = [i for i in range(len(new1)) if (new1[i] % 3 == 0 or new1[i] % 5 == 0 or new1[i] % 15 == 0)]

if len(new1) == len(new2):
  print("APPROVED")
else:
  print("DENIED")

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

a_even = list(filter(lambda x: x % 2 == 0, a))
rtn = all(map(lambda x: x % 3 == 0 or x % 5 == 0, a_even))

if rtn:
    print("APPROVED")
else:
    print("DENIED")

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

cnt = 0
even = 0
for i in A:
  if i % 2 == 0:
    even += 1
    if i % 3 == 0 or i % 5 == 0:
      cnt += 1
      
if cnt == even:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
input_int = int(input())
input_list = list(map(int,input().split()))
count_2 = 0
count_3_5 = 0

for i in input_list:
    if i % 2 == 0:
        count_2 += 1
        if i % 3 == 0 or i % 5 == 0:
            count_3_5 += 1

if count_2 == count_3_5:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
def main():
    _ = int(input())
    a = list(map(int, input().split()))
    odds = []
    for i in a:
        if i % 2 == 0:
            odds.append(i)

    for i in odds:
        if i % 3 != 0 and i % 5 != 0:
            print("DENIED")
            return

    print("APPROVED")


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
a = list(map(int,input().split()))
even=[el for el in a if el % 2==0]
try:
  for a in even:
    if a % 3 == 0 or a % 5 == 0:
      flg = 1
    else:
      raise
except:
  print('DENIED')
else:
  print('APPROVED')

Solution (Python):
N = int(input())
tuplea = tuple(map(int, input().split()))
ans = 0
for n in range(N):
    if tuplea[n]%2 == 1:
        pass
    else:
        if tuplea[n]%3 == 0 or tuplea[n]%5 == 0:
            pass
        else:
            ans = 1
if ans == 0:
    print('APPROVED')   
else:
    print('DENIED')

Solution (Python):

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

Solution (Python):
n = int(input())
_list = list(map(int,input().split()))
even = [x for x in _list if x % 2==0]
answer = []
for x in even:
    if x % 3 == 0 or x % 5 == 0:
        answer.append(True)
if len(even) ==len(answer):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n = int(input())
a = input().split(" ")

num = []
for b in a:
    num.append(int(b))

entry = 'APPROVED'
for i in range(0, n):
    if num[i] % 2 == 0:
        if num[i] % 3 == 0:
            continue
        if num[i] % 5 == 0:
            continue

        entry = 'DENIED'
        break

print(entry)

Solution (Python):
N = int(input())
lis = map(int, input().split())
judge = True
for i in lis:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            pass
        else:
            judge = False
    else:
        pass
if judge == True:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):


n = input()
st = input()
hai = []
hai = st.split()
hai_l = [int(s) for s in hai]

ap_fg = 0


for i in range(len(hai_l)) :

  
	if (hai_l[i] % 2) == 0:
      
		if (hai_l[i] % 3) == 0 or (hai_l[i] % 5) == 0:
			ap_fg = ap_fg + 0
		else:
			print('DENIED')
			break
		
	
	else:
		ap_fg = ap_fg + 0
	    
	if ap_fg == 0 and i == len(hai_l)-1:
		print('APPROVED')

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

cnt=True

for i in range(len(a)):
    k=a[i]
    if k%2==0 and (k%3!=0) and (k%5!=0):
            cnt=False
            break

if cnt:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
P=[]
N = int(input())
P = list(map(int, input().split()))

flg=0



for n in range(N):
    if(int(P[n]) % 2):
        pass
    else:
        if((int(P[n])%3 == 0) or (int(P[n])%5 == 0)):
            pass
        else:
            flg=1

if(flg==0):
    print("APPROVED")
else:
    print("DENIED")

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

answer="APPROVED"

for a in A:
    if a%2==0:
        if a%3==0 or a%5==0:
            answer="APPROVED"
        else:
            answer="DENIED"
            break
print(answer)

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n = I()
    ali = LI()
    gusu = 0
    flag = []
    for i in ali:
        if i % 2 == 0:
            gusu += 1
            if i % 3 == 0 or i % 5 == 0:
                flag.append(True)
    if gusu == len(flag):
        print('APPROVED')
    else:
        print('DENIED')



if __name__ == "__main__":
    solve()

Solution (Python):
import math


def readints():
    return list(map(int, input().split()))


n = int(input())
a = readints()
x = 0
y = 0
for i in range(n):
    if a[i] % 2 == 0:
        x += 1
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            y += 1
if x == y:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):


num=int(input())
youso_list=input().split(' ')
boolean=True

for youso in youso_list:
    magic_num=0
    youso=int(youso)
    if youso%2!=0:
        continue
    
    if youso%3!=0:
        magic_num+=1
        
    if youso%5!=0:
        magic_num+=1
    
    if magic_num==2:
        boolean=False
        break

if boolean==False:
    print('DENIED')

elif boolean==True:
    print('APPROVED')

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
t=0
for i in range(n):
    if l[i]%2==0:
        if l[i]%3>0 and l[i]%5>0:
            print("DENIED")
            break
        else:
            t+=1
    else:
        t+=1
if t==n:
    print("APPROVED")

Solution (Python):
def func_b(a):
    if a%2!=0:
        return 0
    elif a%2==0:
        if a%3==0:
            return 0
        elif a%5==0:
            return 0
        else:
            return 1

N = int(input())
A = list(map(int, input().split()))
A_=map(func_b, A)
if sum(A_)!=0:
    print("DENIED")
else:
    print("APPROVED")

Solution (Python):
n = input()
alist = input().split()
intalist = [int(a) for a in alist]
count = 0
intcount = 0
for i in range(0,int(n)):
  if intalist[i] % 2 == 0:
    intcount += 1
    if intalist[i] % 3 == 0:
      count += 1
    elif intalist[i] % 5 == 0:
      count += 1
if count == intcount:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
N = int(input())
applist = list(map(int, input().split()))

newlist = []
for i in applist:
  if i % 2 == 0:
    newlist.append(i)

flag = 0
for j in newlist:
  if j % 3 == 0 or j % 5 == 0:
    flag = 0
  else:
    flag = 1
    break

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

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

A2 = 0
A35 = 0
for i in range(N):
	if A[i]%2 == 0:
		A2 += 1
		if A[i] % 3 == 0 or A[i] % 5 == 0:
			A35 += 1

if A2 == A35:
	print("APPROVED")
else:
	print("DENIED")

Solution (Python):
n = input()
_list = input().split(" ")
_list = [int(x) for x in _list]
even = [x for x in _list if x % 2==0]
answer = []
for x in even:
    if x % 3 == 0 or x % 5 == 0:
        answer.append(True)
if len(even) ==len(answer):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n = int(input())
doc = map(int, input().split())

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

print('APPROVED')

Solution (Python):
import sys
N = int(input())
A = list(map(int, list(input().split())))
E = []
for i in range(N):
    if A[i]%2 == 0:
        E.append(A[i])
if len(E) == 0:
    print('APPROVED')
else:
    for j in range(len(E)):
        if E[j]%3 != 0 and E[j]%5 != 0:
            print('DENIED')
            sys.exit()
    print('APPROVED')

Solution (Python):
N = int(input())
nums = list(map(int, input().split(' ')))
flag = False
for i in range(N):
  if nums[i]%2 == 0 :
    
    if (nums[i]%3 != 0) & (nums[i]%5 != 0):
      flag = True
      print('DENIED')
      break
    else:
      continue
  else:
    continue
if flag == False:
  print('APPROVED')

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
ans = []

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


for i in ans:
	if not(i % 3 == 0 or i % 5 == 0):
		print("DENIED")
		exit()

print("APPROVED")

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
judge = True

for i in range(n):
  if a[i]%2==0 and not (a[i]%3 == 0 or a[i]%5 == 0):
    judge = False

print(['DENIED', 'APPROVED'][judge])

Solution (Python):
N = int(input())
ImmigrantList = list(map(int, input().strip().split()))

ans = 'APPROVED'

for value in ImmigrantList:
    if value % 2 == 0:
        target = value 
        if target % 3 != 0 and target % 5 != 0:
            ans = 'DENIED'
            break
print(ans)

Solution (Python):
def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False

def is_split(num):
    if num % 3 == 0 or num % 5 == 0:
        return True
    else:
        return False

a = int(input())
li1 = list(map(int, input().split()))
li2 = []
flag = False

for i in range(a):
    li2.append(li1[i])

for i in li2:
    if is_even(i):
        if not is_split(i):
            flag = True

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

Solution (Python):




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

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

    for ee in even:
        if (ee % 3) != 0 and (ee % 5) != 0:
            print('DENIED')
            return

    print('APPROVED')


resolve()

Solution (Python):
num = input()
num = int(num)
numinput = input()
numlist = numinput.split(" ")
evenlist = list()
con = 0
maxcon = int(num) * 1000
point = 0
for i in numlist:
  con = con + int(i)
  if int(i) % 2 == 0:
      evenlist.append(i)
  else:
      continue
if num <= 100 and con <= maxcon:
  for i in evenlist:
    if int(i) % 3 == 0 or int(i) % 5 == 0:
      point = point + 1
    else:
      continue
else:
  print("")
if point == len(evenlist):
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
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")

Solution (Python):
N = int(input())
nums = [int(e) for e in input().split()]
for i in range(N):
    if nums[i]%2 == 1:
        pass
    else:
        if nums[i]%3 == 0 or nums[i]%5 == 0:
            pass
        else:
            print("DENIED")
            break
    if i == N-1:
        print("APPROVED")
    else:
        pass

Solution (Python):
import sys
a=int(input())
c=0
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')
      sys.exit()
  else:
    c+=1
    pass
print('APPROVED')

Solution (Python):
N = input()
arr = list(map(int, input().split()))
flag = True
for n in arr:
  if n % 2 == 0 and not (n % 3 * n % 5 == 0):
    print("DENIED")
    flag = False
    break
    
if flag:
  print("APPROVED")

Solution (Python):
N = int(input().strip())
a = list(map(int, input().strip().split()))

flag = 0

for i in a:
  if i % 2:
    b = 1
  else:
    if not(i % 3) or not(i % 5):
      b = 1
    else:
      flag = 1
if flag:
  print("DENIED")
else:
  print("APPROVED")

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

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

if count == count_:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
N = input()
A = input()
A = A.split()

A = [i for i in A if int(i) % 2 == 0]


all_nums = len(A)
A = [i for i in A if int(i) % 3 == 0 or int(i) % 5 == 0]


if len(A) == all_nums:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
N = int(input())
a = list(map(int, input().split()))

isApproved = True

for x in a:
    if x % 2 == 0:
        if not(x % 3 == 0 or x % 5 == 0):
            isApproved = False

if isApproved:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
def Checknum(str_num, input_list):
  for i in input_list:
    if i % 2 == 0:
      if not (i % 3 == 0 or i % 5 == 0):
        return "DENIED"
  return "APPROVED"

stranger_num = input()
input_list = list(map(int, input().split()))
print(Checknum(stranger_num, input_list))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
Guusu = []


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

judge = 0
for i in range(len(Guusu)):
    if Guusu[i] % 3 == 0 or Guusu[i] % 5 == 0:
        None
    else:
        judge = 1

if judge == 0:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    ans = "APPROVED"
    for ai in A:
        if ai%2 == 0:
            if ai%3 > 0 and ai%5 > 0:
                ans = "DENIED"
                break
    print(ans)

    return

if __name__ == "__main__":
    main()

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

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

Solution (Python):
import numpy as np
 
N = int(input())
A = input().split()
A = np.array([int(val) for val in A])
 
A_even = set(A[A%2==0])
A_three = set(A[A%3==0])
A_five = set(A[A%5==0])
 
A_approve = A_even & (A_three | A_five)
 
if A_even == A_approve:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):


import os
import datetime

def main():
    val_1 = int(input())
    val_2 = input()
    val_2_list = val_2.split()

    flag = True

    for i in range(val_1):
        num = int(val_2_list[i])
        if num % 2 == 0:
            if num % 3 != 0 and num % 5 != 0:
                flag = False
                break

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

if __name__ == '__main__':
    main()

Solution (Python):
N = input()
A = [int(ele) for ele in input().split() if int(ele)%2==0]
count=0
for i in A:
    if i%3==0 or i%5==0:
        count+=1
print("APPROVED" if count==len(A) else "DENIED")

Solution (Python):
N=int(input())
data=list(map(int,input().split()))
ans="APPROVED"
for i in range(N):
    mo2=data[i]%2
    mo6=data[i]%6
    mo10=data[i]%10
    if mo2==0:
        if mo6==0 or mo10==0:
            ans="APPROVED"

        else:
            ans="DENIED"
            break
    else:
        continue
print(ans)

Solution (Python):
N = int(input())
immi = list(map(int, input().split()))
flag = 0

for el in immi:
    if el % 2 == 0:
        if not el % 3 == 0:
            if not el % 5 == 0:
                flag = 1
                break
                
if flag == 1:
    print('DENIED')
else:
    print('APPROVED')

Solution (Python):

import sys


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))
    for i in range(N):
        A = int(next(tokens))
        if A%2==0 and A%3 != 0 and A%5 != 0:
            print("DENIED")
            return

    print("APPROVED")
    pass

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
OK = 1
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:
            OK = 1
        else:
            OK = 0
            break
if OK == 1:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N = int(input())
X = [int(x) for x in input().split()]
result = list(filter(lambda x: x % 2 == 0, X))
count = 0
for i in result:
    if i % 3 == 0 or i % 5 == 0:
        count += 1
print('APPROVED' if count == len(result) else 'DENIED')

Solution (Python):
n = int(input())
Lists=list(map(int,input().split()))
x = 0
for i in Lists:
    if i%2==0 and i%3 !=0 and i%5!=0:
        print("DENIED")
        x = 1
        break

if x == 0:
    print("APPROVED")

Solution (Python):
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')
        break
else:
    print('APPROVED')

Solution (Python):
n = input()
l = list(map(int, input().split()))
result = 'APPROVED'
for i in l:
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      result = 'DENIED'
      break
print(result)

Solution (Python):
N = int(input())
lit = [int(x) for x in input().split()]
lit2 = []
for i in range(N):
    if lit[i] % 2 == 0:
        lit2.append(lit[i])
N2 = len(lit2)
lit3 = []
for j in range(N2):
    if lit2[j] % 3 == 0:
        lit3.append(lit[j])
    elif lit2[j] % 5 == 0:
        lit3.append(lit[j])
if len(lit2) == len(lit3):
    print("APPROVED")
else: print("DENIED")

Solution (Python):
a = input()
a = int(a)
 
line = [int(k) for k in input().split()]
for k in range(len(line)):
  if line[k] % 2 == 0:
    if not line[k] % 5 == 0 and not line[k] % 3 == 0:
      print("DENIED")
      break
  if k == a-1:
    print("APPROVED")

Solution (Python):
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 and A[i] % 5 != 0:
            ans = "DENIED"

print(ans)

Solution (Python):
def main():
    N = int(input())
    a = list(map(int, input().split()))    
    even_num = [e for e in a if e % 2 == 0]
    flag = True
    for e in even_num:
        if e % 3 != 0 and e % 5 != 0:
            flag = False
    if flag: print("APPROVED")
    else: print("DENIED")
        
if __name__ == "__main__":
    main()

Solution (Python):
a = input()
num = [int(x) for x in input().split()]
flag = True
for x in num:
  if x % 2 == 0:
    if x % 3 != 0 and x % 5 != 0:
      flag = False
if flag:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
a = []
n = int(input())

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

e = 0  
for i in range(n):
  if a[i] % 2 == 0:
    e += 1
f = 0
for i in range(n):
  if a[i] % 6 == 0 or a[i] % 10 == 0:
    f += 1

if e == f:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
n=int(input())
a=list(map(int, input().split()))
tmp = 0

for i in range(n):
    if a[i] % 2 == 0 and (a[i] % 3 != 0 and a[i] % 5 != 0):
        print('DENIED')
        tmp = 1
        break

if tmp == 0:
    print('APPROVED')

Solution (Python):
N = int(input())
As = list(map(int,input().split()))

for a in As:
    if a % 2 != 0:continue
    if a % 3 == 0 or a % 5 == 0:continue
    else:
        print('DENIED')
        break
else:
    print('APPROVED')

Solution (Python):
l = int(input())
num_lis = list(input().split())

for i in range(l):
    num_lis[i] = int(num_lis[i])

ans = 'APPROVED'
for i in range(l):
    if num_lis[i]%2 == 0:
        if num_lis[i]%3 != 0:
            if num_lis[i]%5 !=0:
                ans ='DENIED'
print(ans)

Solution (Python):
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")
            exit(0)

print("APPROVED")

Solution (Python):
from functools import reduce
from operator import and_
N = int(input())
As = [(i%3==0) or (i%5==0) for i in map(int,input().split()) if i%2==0]
ans = reduce(and_, As, True) if len(As)>0 else True
print("APPROVED" if ans else "DENIED")

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

judge = 'APPROVED'

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

print(judge)

Solution (Python):
N=int(input())
As=[int(e) for e in input().split(' ')]

for A in As:
    if A%2==0:
        if A%3!=0 and A%5!=0:
            break
else:
    print("APPROVED")
    exit()

print("DENIED")

Solution (Python):
import sys
n=int(input())
a=list(map(int,input().split()))
for i in a:
  if i%2==0:
    if i%3 and i%5:
      print("DENIED")
      sys.exit()
print("APPROVED")

Solution (Python):
n=int(input())
lst=list(map(int,input().split()))
A = list(filter(lambda x : x % 2==0, lst))
c=0
for i in A:
    if(i%3==0 or i%5==0):
        c+=1
if(c==len(A)):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n = input()
_list = input().split(" ")
_list = [int(x) for x in _list]
even = [x for x in _list if x % 2==0]
answer = []
for x in even:
    if x % 3 == 0 or x % 5 == 0:
        answer.append(True)
if len(even) ==len(answer):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):


n = int(input())
lst = list(map(int, input().split()))
cnt = 0
ans = 0
lstg = []
for i in lst:
    if (i % 2) == 0:
        lstg.append(i)

for i in lstg:
    if (i % 3) == 0 or (i % 5) == 0:
        cnt += 1

if len(lstg) == cnt or len(lstg) == 0:
    ans = 1
if ans > 0:
    print("APPROVED")
else:
    print("DENIED")