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()))
for i in range(n):
    if a[i]%2 == 1:
        continue
    else:
        if a[i]%3 == 0:
            continue
        elif a[i]%5 == 0:
            continue
        else:
            print ("DENIED")
            exit (0)
print ("APPROVED")

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

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

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

Solution (Python):
N = int(input())
s = list(map(int, input().split()))
kekka = 0

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

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

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

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

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


def is_all_approved(numArry):
    for num in numArry:
        if num % 2 == 0:
            if num % 3 != 0 and num % 5 != 0:
                return False
    return True


if is_all_approved(A):
    print("APPROVED")
else:
    print("DENIED")

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

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

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

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

for i in range(len(temp_list)):
  if not (temp_list[i] % 3 == 0 or temp_list[i] % 5 == 0):
    flag = 0
    
if flag == 1:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
import numpy as np
Nnum=int(input())
An=np.array([int(i) for i in input().split()])
Ane=An[An%2==0]
Ane3=Ane%3
Ane5=Ane%5
Ane3or5=Ane3*Ane5

if(np.sum(Ane3or5)==0):
    print("APPROVED")
else:
    print("DENIED")

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

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

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

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

print(ans)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
X = 0
Y = 0
for i in range(0,N):
  if A[i] % 2 == 0:
    X += 1
    if ((A[i] / 2) % 3 == 0) or ((A[i] / 2) % 5 == 0):
      Y += 1
if X == Y:
  print('APPROVED')
else:
  print('DENIED')

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

Solution (Python):

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

flag = True
for i in range(N):
  if(A[i] % 2 == 0):
    if not(A[i] % 3 == 0 or A[i] % 5 == 0):
      flag = False
      print('DENIED')
      break

if(flag == True):
  print('APPROVED')

Solution (Python):
import sys


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

A_even=[]
for i in A:
    if  (i%2)==0:
        A_even.append(i)
for i in A_even:
    if (i%3)!=0 and (i%5)!=0:
        print("DENIED")
        sys.exit()
print("APPROVED")

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

for i in range(len(a)):
    if a[i] % 2 == 0:
        even_list.append(a[i])
flag = 0
for num in even_list:
    if num % 3 == 0 or num % 5 == 0:
        flag = 0
    else:
        flag = 1
        break
if flag == 1:
    print("DENIED")
else:
    print("APPROVED")

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

Solution (Python):
N = input()
A = list(map(int,input().split()))
flag = True
for a in A:
    if a % 2 == 0:
        if a % 3 != 0:
            if a % 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]
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())
AS = map(int, input().split())

odd = filter(lambda x: x % 2 == 0, AS)
result = filter(lambda x: not (x % 3 == 0 or x % 5 == 0), odd)

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

Solution (Python):
N = int(input())
li = list(map(int,input().split()))
even_li = [x for x in li if x%2 == 0]
ap = 0
for i in even_li:
    if i % 3 == 0 or i % 5 == 0:
        ap += 1
if even_li == []:
    print("APPROVED")
elif ap == len(even_li):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
import math
n = 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 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()))

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

print(ans)

Solution (Python):

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

res= 0
for aa in a:
    if aa%2==0:
        if aa %3 ==0:
            res+=1
            continue

        elif aa%5 ==0:
            res+=1
            continue
    else: 
        res+=1
        continue
            
if res==n:
    print ('APPROVED')
else:
    print('DENIED')

Solution (Python):

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

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

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

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

check = True
for i in A:
    if(i % 2 == 0):
        if(i % 3 != 0 and i % 5 != 0):
            check = False

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

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

Solution (Python):
_ = input()
a=map(int,input().split())
flag = True
for i in a:
  if i%2 == 0:
    if i%3 != 0:
      if i%5 != 0:
        flag = False
        break
if flag:
  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"
            break
print(ans)

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

Solution (Python):
''' Hey stalker :) '''
INF = 10**10
def main():
    
    ''' Cook your dish here! '''
    n = get_int()
    li = get_list()
    for i in li:
        if i%2==0 and not (i%3==0 or i%5==0):
            print("DENIED")
            return
    print("APPROVED")


''' Pythonista fLite 1.1 '''
import sys
from collections import defaultdict, Counter




out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()

print(*out, sep='\n')

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

b = []
c = 0
d = 0

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

for j in range (c):
    if b[j]%3 == 0 or b[j]%5 == 0:
        d = d
    else:
        d = d+1

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

Solution (Python):
def resolve_b():
    n = input()
    l = map(int, input().split())
    c = 0
    even_list = [i for i in l if i % 2 == 0]
    if len(even_list) == 0:
        print("APPROVED")
    else:
        for e in even_list:
            if e % 3 == 0 or e % 5 == 0:
                c+=1
        if c == len(even_list):
            print("APPROVED")
        else:
            print("DENIED")
resolve_b()

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
            break

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

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

Solution (Python):
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:
            continue
        else:
            flag=1

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

Solution (Python):
n = input()
arr = list(map(int, input().split()))
flag = True
for x in arr:
	if x % 2 == 0:
		if x % 3 != 0 and x % 5 != 0:
			flag = False
			break

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

Solution (Python):
number = input()
num_list = input().split(" ")
odd_list = []
for i in num_list:
	if int(i) % 2 == 0:
		odd_list.append(i)
	else:
		pass
ans = 0
for j in odd_list:
    if int(j) % 5 == 0:
        ans += 1
    elif int(j) % 3 == 0:
        ans = ans + 1
    else:
        pass
if ans >= len(odd_list):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N = int(input())
L = map(int, input().split())
ans = 'APPROVED'
for x in L:
  if x%2==0:
    if not (x%3==0 or x%5==0):
      ans = 'DENIED'
print(ans)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
li = []
ans = "APPROVED"

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

for i in li:
  if i % 5 == 0 or i % 3 == 0:
    ans = "APPROVED"
  else:
    ans = "DENIED"
    break
print(ans)

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

ans=1

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

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):
N = int(input())

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

for i in range(N):
    if(A[i] % 2 == 1):
        continue
    else:
        if(A[i] % 3 == 0 or A[i] % 5 == 0):
            continue
        else:
            print('DENIED')
            exit()
print('APPROVED')

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

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

flag = 1
for A_i in A:
    if A_i % 2 == 0:
        if A_i % 3 == 0 or A_i % 5 == 0:
            pass
        else:
            flag = 0
    if flag == 0:
        break

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

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

ans = 'APPROVED'

for i in A:
    if i % 2 == 0:
        if not (i % 3 == 0 or i % 5 == 0):
            ans = 'DENIED'
            break

print(ans)

Solution (Python):
input();l = list(map(lambda x: True if int(x)%2==1or(int(x)%2==0and(int(x)%3==0 or int(x)%5==0)) else False,input().split()))
print("APPROVED" if sum(l)==len(l) else "DENIED")

Solution (Python):


def main():
    n = int(input())
    a_list = list(map(int, input().split()))

    ans = 'APPROVED'

    for i in a_list:
        if divide(i, 2):
            if not divide(i, 3) and not divide(i, 5):
                ans = 'DENIED'
                break
    
    print(ans)

def divide(x, k):
    if x % k == 0:
        return True
    return False

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
A = [int(e) for e in input().split()]
A_even = []
A_1 = []
A_2 = []
for i in range(N):
    if A[i] % 2 == 0:
        A_even.append(A[i])
for i in range(len(A_even)):
    if A_even[i] % 3 != 0:
        A_1.append(A_even[i])
for i in range(len(A_1)):
    if A_1[i] % 5 != 0:
        A_2.append(A_1[i])
if len(A_2) == 0:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
def main():
    number = input()
    temp_list = list(map(int, input().split()))
    count_dict = {"APPROVED":0, "DENIED":0}

    for i in temp_list:
        if i%2 == 0 and (i%3 != 0 and i%5 != 0):
           count_dict["DENIED"] += 1
            
    if count_dict["DENIED"] == 0:
        print("APPROVED")
    else:
        print("DENIED")

if __name__ == "__main__":
    main()

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

flag = 0

for num in num_list:
    if ((num % 2) == 0) and (((num % 3) > 0) and ((num % 5) > 0)):
        flag = 1
        break

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

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

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()) 
L = map(int, input().split())
flag = 0
listn = []
for i in L:
    if (i % 2) == 0:
        listn.append(i)

for j in listn:
    if ((j % 3)==0) | ((j % 5)==0):
        continue
    else:
        flag=1
        break

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

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"
            break
        
print(ans)

Solution (Python):
time=int(input())
nums=[int(i) for i in input().split()]
odd=0
even=0
even35=0
for j in range(time):
    if nums[j]%2==0:
        even+=1
        if nums[j]%3!=0 and nums[j]%5!=0:
            continue
        else:
            even35+=1
    else:
        odd+=1
        
if even35==even:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N = int(input())
A = input().split()
A = [int(a) for a in A if int(a) % 2 == 0]

tmp = 0

for a in A:
  if a % 3 == 0 or a % 5 == 0:
    tmp += 1

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

Solution (Python):
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 and a[i] % 5 != 0:
      F = 1
      
if F == 1:
  print('DENIED')
else:
  print('APPROVED')

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

A = sorted([int(x) for x in input().split()])
flag = True
isOk = False
for i in A:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            isOk = True
        else:
            isOk = False
            flag = False
            break
    else:
        pass


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

Solution (Python):
def solve():
    N, *A = map(int, open(0).read().split())
    B = [a for a in A if a % 2 == 0]
    
    for b in B:
        if b % 3 != 0 and b % 5 != 0:
            print('DENIED')
            exit()
    print('APPROVED')


if __name__ == '__main__':
    solve()

Solution (Python):
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy




def main():
    N = int(input())
    A = map(int, input().split())
    for a in A: 
        if a % 2 == 0:
            if not (a % 3 == 0 or a % 5 == 0):
                return "DENIED"
    return "APPROVED"

if __name__ == '__main__':
    print(main())

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

L = []
for i in range(N):
    if A[i] % 2 == 1:
        L.append("A")
    elif A[i] % 2 == 0 and A[i] % 3 == 0:
        L.append('A')
    elif A[i] % 2 == 0 and A[i] % 5 == 0:
        L.append('A')
    else:
        L.append('D')
if set(L) == {'A'}:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
from sys import*
n=int(input())
a = [int(i) for i in input().split()]
for i in a:
  if i % 2:
    continue
  if i % 3 and i % 5:
    print("DENIED")
    exit(0)
print("APPROVED")

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

for i in a:
    if i % 2 == 0:
        if i % 3 == 0:
            pass
        elif i % 5 == 0:
            pass
        else:
            s = 1
            print('DENIED')
            break
if s != 1:
    print('APPROVED')

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

even_As = [a/2 for a in As if a % 2 == 0]
TorF = [True if (half_a % 3 == 0) or (half_a % 5 == 0)
else False
for half_a in even_As 
]

if all(TorF):
    print('APPROVED')
else:
    print('DENIED')

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

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

count1 = 0
count2 = 0

for i in range(N):
    if A[i]%2 == 0:
        count1+=1
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            count2 += 1
            
if count1 == count2:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
N = int(input())
A = [int(i) for i in input().split() if int(i) % 2 == 0]
t = 0
for x in A:
    if x % 3 != 0 and x % 5 != 0:
        t += 1
if t == 0:
    print('APPROVED')
else:
    print('DENIED')

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

Solution (Python):
n=int(input())
a=[int(i) for i in input().split()]
b=0
for j in range(n):
  if a[j]%2==0 and a[j]%3!=0 and a[j]%5!=0:
    b+=1
if b==0:
  print('APPROVED')
if b>=1:
  print('DENIED')

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

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=[]*N
A=input().split()
c=True
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:
            c=False
if (c==True):
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
nLen = int(input())
items = input().split()
evens = []

for i in items:
  item = int(i)
  if item % 2 == 0:
    evens.append(item)
    
nLenEvens = len(evens)

OKs = []
for i in evens:
  if i%3 == 0 or i%5 == 0:
    OKs.append(i)
    
if nLenEvens == len(OKs):
	print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n = 0
a = []

def format_input(filename = None):
	global n
	global a
	if filename == None:
		n = map(int, input().split())
		a = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(1, 10**2)
		a = [rng(1, 10**3) for i in range(n)]

def get_answer():
	check = 'APPROVED'
	for i in a:
		if i % 2 == 0 and (i % 3 != 0 and i % 5 != 0):
			check = 'DENIED'
	return check

if __name__ == '__main__':
	format_input()

	ans = get_answer()
	print(ans)

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

flag = 0
for num in range(N):
    tmp = A[num]
    flag = 0 if (tmp%2==0 and (tmp%3==0 or tmp%5==0)) or tmp%2==1 else 1
    if flag == 1:
        break

ans = 'APPROVED' if flag==0 else 'DENIED '
print(ans)

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

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

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

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

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
X = [i for i in A if i % 2 == 0]
ans = 1
for p in X:
    if p % 3 == 0 or p % 5 == 0:
        pass
    else:
        ans *= 0

if ans == 0:
    print('DENIED')
if ans == 1:
    print('APPROVED')

Solution (Python):

import numpy as np


N = int(input().strip())
x = [int(str) for str in input().strip().split()]

x = np.array(x)
odd = x[x % 2 == 0]

result = np.all((odd % 3 == 0) | (odd % 5 == 0))

print('APPROVED' if result else 'DENIED')

Solution (Python):
def is_even(num):
    return num % 2 == 0
num = int(input())
fn = list()
input = input().split(" ")
b = list()
for e in input:
  if is_even(int(e)):
    fn.append(e)
for a in fn:
  if int(a) % 3 == 0 or int(a) % 5 == 0:
    b.append("0")
  else:
    b.append("1")
if "1" in b:
  print("DENIED")
else:
  print("APPROVED")

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

result = "APPROVED"

for i in range(N):
    if not( (A[i] % 2 == 1) or ((A[i] % 2 == 0) and (A[i] % 3 == 0 or A[i] % 5 == 0)) ):
        result ="DENIED"
        break


print(result)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
count = 0
for i in range(N):
  if A[i] % 2 == 0:
    if A[i] %3 ==0 or A[i] %5 ==0:
      count +=1
    else:
      count -=10000
      break
if count >=0:
  print("APPROVED")
else:
  print("DENIED")

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

hantei = True

for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0:
            if a[i] % 5 != 0:
                hantei = False

if hantei == True:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):


n = int(input())

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

isApl = True

for num in nums:
    if num%2 == 0:
        if num%3 == 0:
            pass
        elif num%5 == 0:
            pass
        else:
            isApl = False
            break

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

Solution (Python):
N = int(input())
doc = [int(x) for x in input().split() if int(x) % 2 == 0]
for i in doc:
  if i % 3 != 0 and i % 5 != 0:
    print('DENIED')
    exit()
print('APPROVED')

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 = input().split()
T = "APPROVED"
for i in range(N):
    m = int(A[i])
    if m % 2 == 0:
        if (m % 3 != 0) and (m % 5 != 0):
            T = "DENIED"
            break
print(T)

Solution (Python):
import sys


TEST_INPUT = [
    """
    5
    6 7 9 10 31
    """,
    """
    3
    28 27 24
    """
]
ANSWER = [
    "APPROVED",
    "DENIED"
]


class InputHandler:

    def __init__(self, text_lines="", is_test=False):
        self.data = list(text_lines.split("\n"))
        self.index = 0
        self.is_test = is_test

    def input(self):
        if self.is_test:
            self.index += 1
            return self.data[self.index].strip()
        else:
            return sys.stdin.readline().rstrip()


def solve(n, a_list):
    for a in a_list:
        if a % 2 == 0 and a % 3 != 0 and a % 5 != 0:
            return "DENIED"
    return "APPROVED"


def input_and_solve(ih):
    n = int(ih.input())
    a_list = list(map(int, ih.input().split()))
    res = solve(n, a_list)
    return res


def main():
    ih = InputHandler()
    res = input_and_solve(ih)
    print(res)


def test():
    for test_input, ans in zip(TEST_INPUT, ANSWER):
        ih = InputHandler(test_input, True)
        res = input_and_solve(ih)
        assert str(res) == str(ans)


if __name__ == "__main__":
    test()
    main()

Solution (Python):
N = int(input())
A = map(int, input().split())
is_approved = False
evens = [a for a in A if a % 2 == 0]
for e in evens:
  if e % 3 != 0 and e % 5 != 0:
    print('DENIED')
    exit()
print('APPROVED')

Solution (Python):
n = input()
a = list(map(int, input().split()))
count = 0
for i in a:
    if i % 2 == 1:
        count += 1
    elif i % 6 == 0 or i % 10 == 0:
        count += 1
if count == int(n):
    print("APPROVED")
else:
    print("DENIED")

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

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

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

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

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

for i in A:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            pass
        else:
            flag += 1
if flag > 0:
    print("DENIED")

else:
    print("APPROVED")

Solution (Python):
n = input()
arr = [int(_) for _ in input().split() if int(_) % 2 == 0 and int(_) % 3 != 0 and int(_) % 5 != 0]
 
if len(arr) == 0:
  print("APPROVED")
else:
  print("DENIED")

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

ANS = 'APPROVED'
for i in A:
	if (i % 30) in [2, 4, 8, 14, 16, 22, 26, 28]:
		ANS = 'DENIED'

print(ANS)

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

data = input().split(' ')
count = 0
for i in range(0, inp):
  if int(data[i]) % 2 != 0:
    pass
  if int(data[i]) % 2 == 0:
    if int(data[i]) % 3 != 0 and int(data[i]) % 5 != 0:
      count += 1

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

Solution (Python):
i = list(map(int, input().split()))
j = list(map(int, input().split()))

k = []
for e in j:
    if e % 2 == 0:
        k.append(e * e)
l = []
for f in k:
    if f % 3 != 0:
        l.append(f * f)
m = []
for g in l:
    if g % 5 != 0:
        m.append(g * g)
if len(m) == 0:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):

import math
import numpy as np

N = int(input())

An = np.array(input().split(" "), dtype=np.int)

out = 1

for ai in An:
    if ai % 2 == 0:
        if ai % 3 == 0 or ai % 5 == 0:
            pass
        else:
            out = 0

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

Solution (Python):
def check(a):
    for i in range(n):
        if a[i] % 2 == 0:
            if (a[i] % 3 != 0) and (a[i] % 5 != 0):
                return "DENIED"
    return "APPROVED"


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

print(check(a))

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

even_list = []
for a in a_list:
    if a%2==0:
        even_list.append(a)

ans = True
for e in even_list:
    if e%3==0 or e%5==0:
        ans = True
    else:
        ans = False
        break

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

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