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

count = 0

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

Solution (Python):
n = int(input())
listA = list(map(int,input().split()))
res = []
for i in listA:
    if i % 2 == 0:
        if i % 3 ==0 or i % 5==0:
            res.append('OK')
        else:
            res.append('NO')
    else:
        res.append('OK')
if 'NO' in res:
    print('DENIED')
else:
    print('APPROVED')

Solution (Python):

n = int(input())
a = list(map(int,input().split()))
b = []
status = 0

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

for j in range(len(b)):
    if b[j] % 3 == 0 or b[j] % 5 == 0:
        pass
    else:
        status = 1

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

Solution (Python):
import sys

n = input()
data = input()
nums = data.split(' ')

flag = 0
for number in nums:
    num = int(number)
    if num % 2 == 0:
        if not(num % 3 == 0 or num % 5 == 0):
            print('DENIED')
            flag = 1
            break
if flag == 0:
    print('APPROVED')

Solution (Python):
cou = int(input())
a = list(map(int,input().split()))
ans = 0

for i in range(cou):
    b = a[i]
    if b % 2 == 0:
        if b % 3 == 0:
            ans += 1
        elif b %5 == 0:
            ans += 1
        else:
            break
    else:
        ans += 1

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

Solution (Python):
count = int(input())
numbers = input().split(' ')
check = 0

for number in numbers:
    int_number = int(number)
    if int_number % 2 == 0:
        if int_number % 3 == 0:
            continue
        if int_number % 5 == 0:
            continue
        else:
            check = 1
            break




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

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

def valid(x):
    if x % 2 == 0:
        return (x % 3 == 0) or (x % 5 == 0)
    else:
        return True

if all(map(valid, nums)):
    print('APPROVED')
else:
    print('DENIED')

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

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

Solution (Python):
N=int(input())
A=input().split()
count_2=0
count_3_5=0
for i in range(N):
    if int(A[i])%2==0:
        count_2+=1
        if int(A[i])%3==0 or int(A[i])%5==0:
            count_3_5+=1
if count_2==count_3_5:
    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())
A = list(map(int, input().split()))
A_odd = list(filter(lambda x: x%2==0, A))

if (len(list(filter(lambda x: (x%3==0)or(x%5==0) ,A_odd))) == len(A_odd)):
    print('APPROVED')
else:
    print('DENIED')

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


hanntei = 0 

for i in range(N):
    ch1 = A[i] % 2
    ch2 = A[i] % 3
    ch3 = A[i] % 5
    if ch1 == 0 and ch2 != 0 and ch3 != 0:
        hanntei = 1
        break

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

Solution (Python):
n=int(input())
a = list(map(int,input().split()))[:n]
for i in a:
    if i %2 ==0 and not(i%3 ==0 or i%5 ==0):
        print('DENIED')
        exit()

print('APPROVED')

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

d = [i for i in a if i % 2 == 0]
for num in d:
  if num % 3 != 0 and num % 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):
B=int(input())
A=list(map(int,input().split()))

flag=True

for i in A:
    if i%2==0:
        
        if i%3==0 or i%5==0:
            count=0
        else:
            flag=False

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

Solution (Python):
n=input()
inp = [int(ele) for ele in input().split() if int(ele)%2==0]
t=0
for ele in inp:
    if ele%3==0 or ele%5==0:
        t+=1
print("APPROVED" if t==len(inp) else "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())
a = [int(i) for i in input().split()]
ok = True
for i in a :
    if( (i%2 == 0) and (i%3 != 0) and (i%5 != 0)) :
        ok = False
if ok == True:
    print("APPROVED")
else :
    print("DENIED")

Solution (Python):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    admit = True
    for n in range(N):
        if A[n] % 2 == 0 and not (A[n] % 3 == 0 or A[n] % 5 == 0):
            admit = False
    if admit:
        print('APPROVED')
    else:
        print('DENIED')
    
main()

Solution (Python):

cnt  = int(input())
lst = list(map(int, input().split()))

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

print("APPROVED")

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

for i in range(N):
  if A[i]%2==0 and A[i]%3!=0 and A[i]%5!=0:
    s+=1
if s==0:
  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())

s = input().split()


flag = 0

for i in s:
    if(int(i)%2 == 0):
        if(int(i)%3 != 0 and int(i)%5 != 0):
            flag = 1


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

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

ans=True
for i in gus:
    if not i%3==0:
        if not i%5==0:
            print("DENIED")
            ans=False
            break

if ans:
    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 or i%5 == 0:
            continue
        else:
            print("DENIED")
            exit(0)

print("APPROVED")

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

for i in li:
    if i % 2 == 0:
        if i % 3 != 0 and i%5 != 0:
            print("DENIED")
            quit()
print("APPROVED")

Solution (Python):


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

result = "APPROVED"
for n in A:
    if n % 2 != 0:
        continue
    if n % 3 == 0:
        continue
    if n % 5 == 0:
        continue
    result = "DENIED"
    break
print(result)

Solution (Python):
import sys
input = sys.stdin.readline

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

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

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
for a in l:
    if a%2==0:
        if a%3!=0 and a%5!=0:
            print('DENIED')
            exit()
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:
    if A[i] % 3 == 0 or A[i] % 5 == 0:
      pass
    else:
      flag = 1
      break
if flag == 0:
  print("APPROVED")
else:
  print("DENIED")

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

flag = "APPROVED"

for elem in arr_b:
  if elem % 2 == 0:
    if (elem % 3 != 0) and (elem % 5 != 0):
      flag = "DENIED"

print(flag)

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

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

flag = 0
for i in aa:
    if i%3 != 0 and i%5 != 0:
        print('DENIED')
        flag = 1
        break

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

Solution (Python):
N=int(input())
A=map(int, input().split())
def judge(L):
  for a in L:
    if a%2==0:
      if a%3!=0 and a%5!=0:
        return False
  return True

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

Solution (Python):
N,A=int(input()),list(map(int,input().split()))
for i in A:
    if i%2==0:
        if i%3==0 or i%5==0:
            pass
        else:
            print("DENIED")
            exit()
    else:
        pass
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())

lst1 = list(map(int,input().split()))
flag = 1
for i in lst1:
    if i%2==0:
        if i%3!=0 and i%5!=0:
            flag = 0

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

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

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

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

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

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 or a[i] % 5 == 0:
            pass
        else:
            Flag = False
            break
if Flag == True:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
import numpy as np

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

A= np.array(A)

B = A[np.where(A%2==0, True, False)]
C = np.where(B%3==0,True, False) + np.where(B%5==0,True, False)

if C.all():
  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]

ans = 0
for i in a:
    if i%3 == 0 or i%5 == 0:
        ans += 1

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

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

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

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

Solution (Python):
import sys
n = int(input())
ls = list(map(int, input().split()))

for i in ls:
    if i%2==0:
        if i%3==0 or i%5==0:
            pass
        else:
            print("DENIED")
            sys.exit()
else:
    print("APPROVED")

Solution (Python):
input()
print('ADPEPNRIOEVDE D'[any(x%2 == 0 and x%3 and x%5
                            for x in map(int, input().split()))::2])

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

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

if all(map(lambda x: x % 3 == 0 or x % 5 == 0, filter(lambda x: x % 2 == 0, array))):
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):

N = int(input())

flag = False
lst = list(map(int, input().split()))
for elem in lst:
    if elem % 2 == 0:
        if ((elem % 3)==0) or ((elem % 5) ==0):
            pass
        else:
            flag = True
            break
if flag:
    print('DENIED')
else:
    print('APPROVED')

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

count = 0
num = 0
for a in A:
    if a % 2 == 0:
        num += 1
    if a % 2 == 0 and (a % 3 == 0 or a % 5 == 0):
        count += 1
if count == num:
    print("APPROVED")
else:
    print("DENIED")

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

    E = []
    for a in A:
        if a % 2 == 0:
            E.append(a)

    for e in E:
        if e % 3 == 0 or e % 5 == 0:
            continue
        else:
            print("DENIED")
            return

    print("APPROVED")


if __name__ == "__main__":
    main()

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

a = "APPROVED"
d = "DENIED"

even = 0
chk = 0
for i in A:
    if i % 2 == 0:
        even += 1
        if i%3 == 0 or i%5 == 0:
            chk += 1

if even == chk:
    print(a)
else:
    print(d)

Solution (Python):
N = int(input())
lis_A = list(map(int, input().split()))
lis_ev = [i for i in lis_A if i%2==0]
lis_3or5 = [j for j in lis_ev if (j%3==0)|(j%5==0)]
if lis_ev == lis_3or5:
    ans = 'APPROVED'
else :
    ans = 'DENIED'
print(ans)

Solution (Python):
N = int(input())
A = [int(_) for _ in 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 a:
    
    if i % 2 == 0:
        
        if i % 3 != 0 and i % 5 != 0:
            print("DENIED")
            exit()
print("APPROVED")

Solution (Python):
N= int(input())
A = [int(i) for i in input().split()] 

ANS = "APPROVED"
for i in range(N):
	if 0 == A[i]%2:
		if 0 != A[i]%3:
			if 0 != A[i]%5:
				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):

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

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

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

b=0
c=0
for i in range(n):
    if a[i]%2==0:
        b+=1
        if a[i]%3==0 or a[i]%5==0:
            c+=1
if b==c:
    print('APPROVED')
else:
    print('DENIED')

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

for j in B:
    if (int(j)%3 == 0 or int(j)%5 == 0):
        pass
    else:
        print('DENIED')
        exit()
print('APPROVED')

Solution (Python):
import sys
import numpy as np

n = int(input())

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

ng = False
for an in a:
    if (an % 2 != 0):
        continue
    if (an % 3 == 0) | (an % 5 ==0):
        continue
    else:
        ng = True
        break
if ng:
    print("DENIED")
else:
    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):




def main():
    N = input()
    A = [int(i) for i in input().split()]
    even = list(filter(lambda x: x % 2 == 0, A))
    print('APPROVED' if len(even) == len(list(filter(lambda x: x % 3 == 0 or x % 5 == 0, even))) else 'DENIED')

    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 or a % 5 == 0:
            continue
        else:
            print("DENIED")
            exit()
print("APPROVED")

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

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

a = list(map(int,input().split()))
li = []
c = 0
for i in range(len(a)):
    if a[i] % 2 == 0:
        li.append(a[i])

for i in range(len(li)):
    if li[i] % 3 != 0 and li[i] % 5 != 0:
        c =1
        break


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

Solution (Python):
import sys
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):
            print(end="")
        else:
            print("DENIED")
            sys.exit()
print("APPROVED")

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


yn = 'YNeos'
ynflg = False
cnt = 0
ans = None

def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas


N = intinput()
As = list(mulinputs())
As = list(filter(lambda x: x%2 == 0, As))

As2 = list(filter(lambda x: x%3 == 0 or x%5==0, As))

if len(As2) == len(As):
    print('APPROVED')
else:
    print('DENIED')

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

def solve(N, A):
    is_approved = True
    for a in A:
        if a % 2 == 0:
            if not (a % 3 == 0 or a % 5 == 0):
                is_approved = False
                break
    return 'APPROVED' if is_approved else 'DENIED'


if __name__ == '__main__':
    inputs = read()
    print("{}".format(solve(*inputs)))

Solution (Python):
import sys
readline = sys.stdin.readline

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

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

print('APPROVED')

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

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

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


if __name__ == "__main__":
    main()

Solution (Python):
def Main(N, A):
    for z in A:
        if (z % 2 == 0):
            if (z % 3 == 0) or (z % 5 == 0):
                continue
            else:
                return 'DENIED'
    return 'APPROVED'  

def main():
    N = int(input())
    A = list(map(int, input().split()))
    print(Main(N, A))

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
b=list(filter(lambda x:x%2==0,a))
cnt=0
for i in b:
  if i%3==0 or i%5==0:
    cnt+=1
print('APPROVED' if cnt==len(b) else '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 and A[i]%5!=0:
      flag=True
      break
if flag==True:
  print('DENIED')
else:
  print('APPROVED')

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

Solution (Python):
n = int(input())
a= list(map(lambda x: int(x),input().split()))
a_di = [i for i in a if i % 2 == 0]
count = 0
for j in range(len(a_di)) :
    if a_di[j] % 3 == 0 or a_di[j] % 5 == 0  :
        count += 1

if count == len(a_di) :
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
input_line=int(input())
count=0
input_list=map(int,input().split())
approved=True
for item in input_list:
    if int(item)%2==0 and not (int(item)%3==0 or int(item)%5==0):
        approved=False
        break
if approved==True:
    print ("APPROVED")
else:
    print ("DENIED")

Solution (Python):
N = int(input())
A = [int(s) for s in input().rstrip().split(' ')]
k = 1
for i in range(N):
  if A[i] % 2 == 0:
    if A[i] % 3 != 0 and A[i] % 5 != 0:
      k = 0
if k == 1:
  print("APPROVED")
elif k == 0:
  print("DENIED")

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

list = list(map(int, input().split()))
rlist=[]
i=0
r="APPROVED"

while(i<n):
  if(list[i]%2 == 0):
    rlist.append(list[i])
  i+=1

l=len(rlist)
j=0

while(j<l):
  if(rlist[j]%3 != 0):
    if(rlist[j]%5 !=0):
      r="DENIED"
  j+=1

print(r)

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

Solution (Python):
n = int(input())
a = [int(x) for x in input().split() if int(x) % 2 == 0]
for aa in a:
    if aa % 3 == 0 or aa % 5 == 0:
        continue
    else:
        print('DENIED')
        exit()
print('APPROVED')

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


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

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

even_list = [i for i in num_list if (i%2==0) & (i%3!=0 and i%5!=0)]
if len(even_list) == 0:
    print('APPROVED')
else:
    print('DENIED')

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

test = []

for i in num:
    if i % 2 != 0:
        test.append(True)
    elif i % 2 == 0 and i % 3 == 0:
        test.append(True)
    elif i % 2 == 0 and i % 5 == 0:
        test.append(True)
    else:
        test.append(False)

if all(test):
    print("APPROVED")
else:
    print("DENIED")

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

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

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

for a in A:
    if a % 2 == 0:
        if a % 3 == 0:
            continue
        elif a % 5 == 0:
            continue

        else:
            print('DENIED')
            sys.exit()

print('APPROVED')

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

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

flag = True
for val in el:
  if val%3 != 0 and val%5 != 0:
    flag = False

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

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

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

er = 0

for i in range(N):
  if Input_ar[i]%2==0:
    if not((Input_ar[i]%3==0) or (Input_ar[i]%5==0)):
      er += 1
if er == 0:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
a = int(input())
b = [int(s) for s in input().split()]

c = []

for d in b:
    if (d % 2 == 0):
        c.append(d)

ans = []
for d in c:
    if ((d % 3) == 0) or ((d % 5) == 0):
        ans.append(d)

ans = 'APPROVED' if len(c) == len(ans) else 'DENIED'

print(ans)

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

def f2(a):
    for i in a:
        if i % 2==0:
            if (i % 3!=0) and (i % 5 != 0):
                print("DENIED")
                return
    print("APPROVED")
    return
f2(a)

Solution (Python):





def solv(N, A):
    A = [a for a in A if a % 2 == 0]
    for a in A:
        if (a % 3 != 0) and (a % 5 != 0):
            return "DENIED"
    return "APPROVED"


if __name__ == "__main__":

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

    print(ans)

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

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

def cond(A):
    for a in A:
        if a%2==0:
            if (a%3!=0) and (a%5!=0):
                return False
    return True
            
if cond(A):
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
N = int(input().rstrip())
As = [int(x) for x in input().rstrip().split()]
fail_flg = False
for a in As:
    if a % 2 == 1:
        continue
    elif not (a % 2 == 0 and (a % 3 == 0 or a % 5 == 0)):
        fail_flg = True
        break
if fail_flg:
    print('DENIED')
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:
    if a[i] % 3 != 0 and a[i] % 5 != 0:
      flag = 1
    
    
if flag == 0:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
len = int(input())
nums = [int(i) for i in input().split()]

af = 0
for i in nums:
  if i % 2 == 0:
    if (i % 3 == 0) | (i % 5 == 0):
      pass
    else:
      af = 1
      break
if af == 1:
  print('DENIED')
else:
  print('APPROVED')

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

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

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

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

flag=True
for i in even:
    if i%3==0 or i%5==0:
        pass
    else:
        flag=False

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

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
flag = False
count1 = 0
count2 = 0
flag = False
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:
  flag = True

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

Solution (Python):
N = int(input())
s = [int(x) for x in input().split()]
 
a = 0
for i in range(N):
    if s[i]/2 == s[i]//2:
        if s[i]/3 == s[i]//3 or s[i]/5 == s[i]//5:
          a = a + 1
    else:
        a = a + 1
 
if a == N:
    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')
      break
  else:
    continue
else:
  print('APPROVED')

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

l2=[x for x in l if x%2==0]
l3=[y for y in l2 if (y%3==0 or y%5==0)]

if l2==l3:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N = int(input())
A = input().split()
A_i = [int(i) for i in A]

A_even = [i for i in A_i if i % 2 == 0]

flag = 0
for even in A_even:
  if even % 3 != 0 and even % 5 != 0:
    flag = 1

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

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 or A[i]%5==0:
            continue
        else:
            print("DENIED")
            break
else:
    print("APPROVED")

Solution (Python):


iim = lambda: map(int, input().rstrip().split())

def resolve():
    N = int(input())
    A = tuple(iim())

    for x in A:
        if (x % 2 == 0) and x % 3 and x % 5:
            print("DENIED")
            return
    print("APPROVED")

if __name__ == "__main__":
    resolve()

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

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

Solution (Python):
N = input()
papers = input().split(" ")
papers = [int(n) for n in papers]
accepted = True
for paper in papers:
    if (paper % 2 == 0):
        if (paper % 3 == 0) | (paper % 5 == 0):
            pass
        else:
            accepted = False
    else:
        pass

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

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

test = True
for i in a:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      continue
    else:
      test = False
      break
if test:
  print('APPROVED')
else:
  print('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 and a[i] % 5 != 0:
            flag = 1
if flag == 0:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n = input()
l = list(map(int,input().split()))
l = [x for x in l if x%2==0]
l = [x for x in l if (x%3!=0) and (x%5!=0)]
if len(l) == 0:
    print('APPROVED')
else:
    print('DENIED')

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

A_set = list(set(A))

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

Solution (Python):


import re
import numpy as np
import math

n=input()

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

ans = 'APPROVED'
for i in a:
  if (i%2)>0:
    continue
  else:
    if ((i%3)>0) and ((i%5)>0):
      ans = 'DENIED'
      break

print(ans)