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 = int(input())
a = list(map(int,input().split()))
flag = True
for i in a:
    if i%2==0:
        if not(i%3==0 or i%5==0):
            flag = False
            break
print("APPROVED" if flag else "DENIED")

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

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

Solution (Python):
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    ans = 'APPROVED'
    for i in a:
        if i%2:continue
        if i%3!=0 and i%5!=0:
            ans = 'DENIED'
    print(ans)
resolve()

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")
        exit()
print("APPROVED")

Solution (Python):
n = int(input())
A = map(int, input().split())
flag = True

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

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

Solution (Python):
import sys

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

for num in A:
    if num % 2 == 0:
        if not (num % 3 == 0 or num % 5 == 0):
            print("DENIED")
            sys.exit()

print("APPROVED")

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

print("APPROVED")

Solution (Python):
import sys
N = int(input())
lsA = list(map(int,input().split()))
for i in range(N):
    if lsA[i] % 2 == 0:
        if lsA[i] % 3 == 0 or lsA[i] % 5 == 0:
            continue
        else:
            print('DENIED')
            sys.exit()
print('APPROVED')

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

for a in A:
    if a%2==1:
        continue
    if a%3==0 or a%5==0:
        continue
    print('DENIED')
    exit()
print('APPROVED')

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

mod_check=0
mod_check_ =0

for i in l:
    if i % 2 == 0 :
        mod_check += 1
        if i % 3 == 0 or i % 5 == 0:
            mod_check_ += 1
        else:
            pass
    else:
        pass

print('APPROVED') if mod_check==mod_check_ 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()

else:
    print('APPROVED')

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')
      exit()
print('APPROVED')

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 or a[i]%5==0:
			b=1

		else:
			print("DENIED")
			break
else:
	print("APPROVED")

Solution (Python):
n = int(input())
a = list(map(int , input().split()))
even = []
count = 0

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

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

if count == len(even):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
j = 0
for i in A:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            pass
        else:
            j += 1
    else:
        pass
if j > 0:
    print('DENIED')
else:
    print('APPROVED')

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

even = []
approved = 0

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

for x in even:
    if x % 3 == 0 or x % 5 == 0:
        approved += 1

if approved == len(even):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
input()
a=[a for a in map(int,input().split())if a%2==0]
r="DENIED"
for i in a:
	if i%3 and i%5:break
else: r="APPROVED"
print(r)

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
a=[i for i in A if i%2==0]
b=len([i for i in a if i%3==0 or i%5==0])
if len(a)==b:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
n, *a = map(int, open(0).read().split())
print("DENIED" if sum((i % 3) * (i % 5) for i in a if i % 2 == 0) else "APPROVED")

Solution (Python):
import numpy as np

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

A = A[A%2==0]
if (np.all((A%3==0) | (A%5==0))==True):
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):

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

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

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

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a_ = [i for i in a if i % 2 == 0]

for i in a_:
    bool_3 = i % 3 != 0
    bool_5 = i % 5 != 0
    if bool_3 and bool_5:
        print('DENIED')
        break
else:
    print('APPROVED')

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

Solution (Python):
n = int(input())
lst = list(map(int, input().split()))
a = list()
count = 0
for i in range(n):
    if lst[i] % 2 == 0:
        a.append(lst[i])

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

if count == len(a):
    print("APPROVED")
else:
    print("DENIED")

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

list2=[]
for i in list1:
    if i%2==0:
        list2.append(i)
    else:
        continue

list3=[]
for j in list2:
    if j%3==0 or j%5==0:
        list3.append(j)
    else:
        continue

x=len(list2)
y=len(list3)

if x==y:
    print('APPROVED')
else:
    print('DENIED')

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

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

result = 'APPROVED'
for anum in anums:
    if (anum % 2 == 0) and not ((anum % 3 == 0) or (anum % 5 == 0)):
        result = 'DENIED'
        break

print(result)

Solution (Python):
N = int(input())
A = input().split()
num_even = 0
num_approved = 0

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

if num_even == num_approved:
    print("APPROVED")
else:
    print("DENIED")

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

res = 'APPROVED'
for num in a:
    if num % 2 == 0:
        if num % 3 != 0 and num % 5 != 0:
            res = 'DENIED'
            break

print(res)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
count=0
total=0
for i in range(n):
    if a[i]%2==0:
        count+=1
        if a[i]%3==0 or a[i]%5==0:
            total+=1
if count==total:
    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):
def main():
    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:
                return ("DENIED")
    return ("APPROVED")

print(main())

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


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


ok_list = []
ng_list = []

for i in num:
    if i % 2 == 1:
        ok_list.append(i)

    elif i % 3 == 0 or i % 5 == 0:
        ok_list.append(i)

    else:
        ng_list.append(i)

if not ng_list:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
res = "APPROVED"
for i in range(n):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 and a[i] % 5 != 0:
      res = "DENIED"
print(res)

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

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

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

count = 0
for item in A:
  if item % 2 == 0:
    if item % 3 == 0 or item % 5 == 0:
      count += 1
  else:
    count += 1

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

Solution (Python):
N=input()
I=list(map(int,input().split()))
E=list(filter(lambda x:x%2==0,I))
if len(E)==0:
    print('APPROVED')
else:
    O=list(filter(lambda r:r%3!=0 and r%5!=0,E))
    if len(O)==0:
        print('APPROVED')
    else:
        print('DENIED')

Solution (Python):
n = int(input())

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

result = "APPROVED"
for num in nums:
    if (num % 2 == 0) and not ((num % 3 == 0) or (num % 5 == 0)):
        result = "DENIED"
        break

print(result)

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 or a[i]%5==0): pass
    else: print('DENIED'); exit()
print('APPROVED')

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
ok = True
for i in range(n):
    if a[i] % 2 == 0 and a[i] % 3 != 0 and a[i] % 5 != 0:
        ok = False
if ok:
    print("APPROVED")
else:
    print("DENIED")

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

for i in a:
    if i % 2 ==0:
        if i % 3 != 0 and i % 5 != 0:
            count+= 1


if count >= 1:
    print("DENIED")
else:
    print("APPROVED")

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

i = 0
for document in documents:
    if document % 2 == 0:
        if not (document % 3 == 0 or document % 5 == 0):
            i = i + 1

if 1 <= i:
    print("DENIED")
else:
    print("APPROVED")

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
answer = "APPROVED"
for i in range(N):
  if A[i] % 2 == 0:
    if A[i] % 3 != 0 and A[i] % 5 != 0 :
      answer = "DENIED"
print(answer)

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

Solution (Python):
S_list = [input() for i in range(2)]
S_list_1 = list(map(int,S_list[1].split()))

for i in S_list_1:   
    if i % 2 == 0 :
        if i % 3 !=0 and i % 5 !=0 :
            result="DENIED"
            break
    else:
        result="APPROVED"        
print(result)

Solution (Python):
def main():
    _ = int(input())
    A = list(map(int,input().split()))
    for i in A:
        if i%2 == 0:
            if i%3 != 0 and i%5 != 0:
                return ("DENIED")
    return ("APPROVED")

print(main())

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

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
t = 0
for i in range(N):
    a = A[i]
    if a%2 == 0:
        if a%3 != 0 and a%5 != 0:
            t += 1
            break

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

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

for x in p:
  if x % 2 == 0:
    if x % 3 != 0 and x % 5 != 0:
      print("DENIED")
      break

else :
  print("APPROVED")

Solution (Python):



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

even = 0
cnt = 0

for i in a:
    if i % 2 == 0:
        even += 1
        if i % 3 == 0 or i % 5 == 0:
            cnt += 1

if even == cnt:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
n = int(input())
a = list(filter(lambda x : x & 1 or x % 3 == 0 or x % 5 == 0, map(int, input().split())))
print('APPROVED' if len(a) == n else 'DENIED')

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

result = "APPROVED"
for a in A:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            result = "DENIED"

print(result)

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

Solution (Python):
_ = input()
l = list(map(int, input().split(' ')))
print('APPROVED' if all([(a % 2 == 1 or a % 3 == 0 or a % 5 == 0) for a in l]) else 'DENIED')

Solution (Python):
n = input()
a = map(int, input().split())
print('APPROVED' if all(ai % 2 == 1 or ai % 3 == 0 or ai % 5 == 0 for ai in a) else 'DENIED')

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

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

print("APPROVED")

Solution (Python):
import os, sys, re, math

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

answer = 'APPROVED'
for a in A:
    if a % 2 == 0:
        if not (a % 3 == 0 or a % 5 == 0):
            answer = 'DENIED'
            break

print(answer)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
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'

print(ans)

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]
res = "APPROVED"
for i in range(n):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 and a[i] % 5 != 0:
      res = "DENIED"
print(res)

Solution (Python):
'''
問題：
    あなたは AtCoder 王国の入国審査官です。
    入国者の書類にはいくつかの整数が書かれており、あなたの仕事はこれらが条件を満たすか判定することです。
    規約では、次の条件を満たすとき、またその時に限り、入国を承認することになっています。
        書類に書かれている整数のうち、偶数であるものは全て、3 または 5 で割り切れる。
    上の規約に従うとき、書類に N 個の整数 A1,A2,…,AN
    が書かれた入国者を承認するならば APPROVED を、しないならば DENIED を出力してください。
'''

'''
制約：
    入力はすべて整数
    1 ≤ N ≤ 100
    1 ≤ Ai ≤ 1000
'''
def is_even(num):  
    if num % 2 == 0:
        return True
    else:
        return False

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



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

result = 'APPROVED'
for i in numbers:
    if is_even(i):
        if is_fizzbuzz(i):
            result = 'APPROVED' 
        else:
            result = 'DENIED'   
            break

print(result)

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

answer = 'DENIED'
for i in range(0, N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            answer = 'APPROVED'
        else:
            answer = 'DENIED'
            break
    else:
        answer = 'APPROVED'

print(answer)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
B = len([i for i in A if i % 2==0])
count = 0
for i in A:
    if i % 2 !=0:
        continue
    elif i % 3 ==0 or i % 5==0:
        count  +=1
if count == B:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
n = int(input())
list01 = input().split()
x = 0
for i in list01:
    if int(i) % 2 != 0:
        pass
    elif int(i) % 3 == 0:
        pass
    elif int(i) % 5 == 0:
        pass
    else:
        x += 1
        break

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
from collections import Counter
def main():
    N = I()
    A = LI()
    for a in A:
        if a % 2 == 0:
            if a % 3 != 0 and a % 5 !=0:
                print('DENIED')
                exit()
    print('APPROVED')

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
approved = all([i % 2 != 0 or i % 10 == 0 or i % 6 == 0 for i in map(int, input().split())])
print('APPROVED' if approved  else 'DENIED')

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

    flag = True 

    for n in range(N):
        if A[n] % 2 == 0 and A[n] % 3 != 0 and A[n] % 5 != 0:
            flag = False
    
    print('APPROVED') if flag else print('DENIED') 


if __name__ == '__main__':
    main()

Solution (Python):


def atc_155b(input_value: str) -> str:
    N = int(input_value[0])
    Ai = [int(ai) for ai in input_value[1].split(" ")]
    for i in range(0, N):
        if Ai[i] % 2 == 0 and Ai[i] % 3 != 0 and Ai[i] % 5 != 0:
            return "DENIED"
    return "APPROVED"

N = input()
Ai = input()
print(atc_155b([N, Ai]))

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

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

print("APPROVED")

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

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

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

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
ans = 'APPROVED'
for ai in a:
  if ai % 2 == 0 and ai % 3 != 0 and ai % 5 != 0:
    ans = "DENIED"
print(ans)

Solution (Python):
N = int(input())
data = list(map(int,input().split()))
sw1 = 0
sw2 = 0
for i in range(0,len(data)):
    if data[i] % 2 == 0:
        sw1 += 1
        if data[i] % 3 == 0 or data[i] % 5 == 0:
            sw2 += 1

if sw1 >= 0 and sw1 == sw2:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
for a in A:
  if a % 2 == 1:
    continue
  else:
    if a%3 != 0 and a%5 != 0:
      print("DENIED")
      break
else:
  print("APPROVED")

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
b=[]
f=1
for i in a:
    if i%2==0:
        b.append(i)
for j in b:
    if not (j%3==0 or j%5==0):
        f=0
if f:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):

num_cnt = int(input())
num_list = list(map(int,input().split()))


judge = "APPROVED"
for cnt in range(0,num_cnt,1):
    if num_list[cnt] % 2 == 0\
    and num_list[cnt] % 3 != 0\
    and num_list[cnt] % 5 != 0:
      judge = "DENIED"
      
print(judge)

Solution (Python):
N = int(input())
list_A = [int(m) for m in input().split()]

for i in list_A:
    if i % 2 != 0:
       continue
    elif not (i % 3 == 0 or i % 5 == 0):
            print("DENIED")
            exit()


print("APPROVED")

Solution (Python):
N = int(input())
list_A = [int(m) for m in input().split()]

for i in list_A:
    if i % 2 != 0:
       continue
    elif not (i % 3 == 0 or i % 5 == 0):
            print("DENIED")
            exit()

else:
    print("APPROVED")

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

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
even = [i for i in A if i % 2 == 0]

if all([i % 3 == 0 or i % 5 == 0 for i in even]) == True:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
for i in A:
  if i%2==1 or i%3==0 or i%5==0:
    continue
  print("DENIED")
  exit()
print("APPROVED")

Solution (Python):
N=int(input())
Alist=list(map(int,input().split()))
ans=0
for i in range(N):
  if Alist[i]%2==0:
    if Alist[i]%3!=0 and Alist[i]%5!=0:
      ans=1
      break
print("APPROVED"*(1+(-1)*ans)+"DENIED"*ans)

Solution (Python):


N = int(input())
my_list = list(input().split())
j = 0

for i in range(0, N):
    if int(my_list[i]) % 2 == 0:
        if int(my_list[i]) % 3 != 0 and int(my_list[i]) % 5 != 0:
            j += 1

if j != 0:
    print('DENIED')
else:
    print('APPROVED')

Solution (Python):

def main():
    n = int(input())
    a = list(map(int, input().split(" ")))
    x = []
    for i in a:
        if i % 2 == 0:
            if not(i % 3 == 0 or i % 5 == 0):
                print("DENIED")
                return
    print("APPROVED")
    return


if __name__ == "__main__":
    main()

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

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

Solution (Python):
n = int(input())

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

deny_list = 0

for i in a:
    if i % 2 == 0 and i % 3 !=0 and i % 5 !=0:
        deny_list += i

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

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

Solution (Python):

def main():
    _ = int(input())
    A = [int(x) for x in input().split()]

    flag = True
    for a in A:
        if a % 2 == 0:
            if a % 3 == 0 or a % 5 == 0:
                pass
            else:
                flag = False
                break
    if flag:
        print('APPROVED')
    else:
        print('DENIED')


if __name__ == '__main__':
    main()

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

Solution (Python):

def calc_digit_sum(num):
    digits = sums = 0
    while num > 0:
        digits += 1
        sums += num % 10
        num //= 10
    return digits, sums


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

candidate = [n for n in arr if n % 2 == 0]
for check in candidate:
    if check % 3 != 0 and check % 5 != 0:
        print("DENIED")
        exit()

print("APPROVED")

Solution (Python):
import sys
n=int(input())
a=list(map(int,input().split()))
b=a[:]

for i in range(len(a)):
    if a[i]%2!=0:
        b.remove(a[i])

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

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

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

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
for a in A:
    if a % 2 == 1:
        continue
    elif a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            print("DENIED")
            exit()
print("APPROVED")

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
import numpy as np
def main():
    a = np.fromstring(read(), np.int64, sep=' ')[1:]
    a = a[a % 2 == 0]
    if np.all((a % 3 == 0) | (a % 5 == 0)):
        print('APPROVED')
    else:
        print('DENIED')

if __name__ == '__main__':
    main()

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

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

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

if ch == 0:
    ans = 'APPROVED'
else:
    ans = 'DENIED'

print(ans)

Solution (Python):

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

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

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()

else:
    print('APPROVED')

Solution (Python):
n = int(input())
list_a = [int(m) for m in input().split()]
for i in list_a:
    if i % 2 != 0:
        continue
    elif not (i % 3 == 0 or i % 5 == 0):
        print("DENIED")
        exit()
print("APPROVED")

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

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


print('APPROVED')

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

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

print('APPROVED')

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

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

boolian = True

for i in range(N):
    if an[i] % 2 == 0:
        if an[i] % 3 ==0 or an[i] % 5 ==0:
            boolian = True
        else:
            boolian = False
            break
if boolian == False:
    print('DENIED')
    
if boolian == True:
    print('APPROVED')

Solution (Python):
N = int(input())
S = list(map(int,input().split()))
B= list()
X = list()
for i in S:
    if i % 2== 0:
        B.append(i)
for n in B:
    if n % 3 == 0 or n % 5 == 0:
        X.append(n)
if len(B) == len(X):
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
N = input()
ints = (i for i in map(int, input().split()) if i % 2 == 0)
ints = (i % 3 == 0 or i % 5 == 0 for i in ints)
print('APPROVED' if all(ints) else 'DENIED')

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

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

print('APPROVED')

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

flg = True
for a in al:
    if a%2 == 0:
        if a%3 == 0 or a%5 == 0:
            continue
        else:
            flg = False
            break

if flg:
    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):
num_num = int(input())
numbers = list(map(int, input().split()))
numbers_even = []

for i in range(num_num):
    if numbers[i] % 2 == 0:
        numbers_even.append(numbers[i])
    else:
        pass
i = 1
for even in numbers_even:
    if even % 3 == 0 or even % 5 == 0:
        i += 1
        if i == num_num:
            break
    else:
        print("DENIED")
        exit()

print("APPROVED")

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())
a = list(map(int, input().split()))
print("APPROVED" if all(i % 5 == 0 or i % 3 == 0 for i in a if i % 2 == 0) else "DENIED")

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:
        result = 'No'
        break
    else:
        result = 'Yes'

if result == 'No':
    print('DENIED')
else:
    print('APPROVED')

Solution (Python):
ri = lambda S: [int(v) for v in S.split()]
def rii(): return ri(input())

N = int(input())
A = [v for v in rii() if v % 2 == 0]

print("APPROVED" if all(v % 3 == 0 or v % 5 == 0 for v in A) else "DENIED")

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

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

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


for n in range(len(List)):
    if List[n] % 3 == 0:
        pass
    elif List[n] % 5 == 0:
        pass
    else:
        flag += 1
        break

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

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

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

print(ans)

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

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

Solution (Python):
counts_number = int(input())
tmp_map = map(int, input().split())
num_list = list(tmp_map)
even_of_num_list = []
approve_counts = 0

for i in num_list:
    if i % 2 == 0:
        even_of_num_list.append(i)

for x in even_of_num_list:
    if x % 3 == 0 or x % 5 == 0:
        approve_counts += 1

if approve_counts == len(even_of_num_list):
    print('APPROVED')
else:
    print('DENIED')