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())
l = list(map(int, input().split()))
check = True
for i in range(n):
    if l[i] % 2 == 1:
        next
    else:
        if l[i] % 3 == 0 or l[i] % 5 == 0:
            next
        else:
            check = False
if check:
    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:
            if i%5!=0:
                ans = "DENIED"
                break
print(ans)

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

p = 'APPROVED'

for i in a:
  if i % 2 == 0:
    if i % 3 != 0:
      if i % 5 != 0:
        p = 'DENIED'
        break
print(p)

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


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


ans()

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

Solution (Python):

N = int(input())
A = [int(x) for x in input().split()]
i = 0
ans = "APPROVED"
while i<N:
    if A[i]%2 == 1:
        i +=1
        continue
    elif A[i]%5 == 0 or A[i]%3 == 0:
        i +=1
        continue
    else:
        ans = "DENIED"
        break
print(ans)

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

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

Solution (Python):
import numpy as np
import math as m

def main(**kwargs):
    r = "APPROVED"

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

            else:
                r = "DENIED"

    return r

if __name__ == "__main__":
    cin = np.array(input().split(" ")).astype("int")
    n, *_ = cin
    
    cin = np.array(input().split(" ")).astype("int")
    A = np.array(cin)
    
    cout = main(n=n, A=A)
    print(cout)

Solution (Python):
N = input()
num = input().split(" ")
count = int(0)
for i in range(int(N)):
  if (int(num[i]) % 2) == 1:
    pass
  elif (int(num[i]) % 3) != 0 and (int(num[i]) % 5) != 0:
    print("DENIED")
    count = count + 1
    break
  else:
    pass

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

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

A_even =list()

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

miss = True


for i in range(len(A_even)):
    if A_even[i]%3 == 0 or A_even[i]%5 == 0:
        pass
    else:
        miss = False
        break
if miss:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
Gu = []
Ki = []
x = 0
for i in L:
    if i % 2 == 0:
        Gu.append(i)
for i in Gu:
    if i % 3 == 0 or i % 5 == 0:
        x += 0
    else:
        x += 1
if x > 0:
    print('DENIED')
if x == 0:
    print('APPROVED')

Solution (Python):
import collections
N = int(input())
A = 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())
inp=input().split()
ok=True
for k in range(n):
  a=int(inp[k])
  if a%2==0:
    if (a%3!=0) and (a%5!=0):
      print('DENIED')
      ok=False
      break
if ok==True:
  print('APPROVED')

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

for x in l:
    if x%2 == 0:
        if not(x%3 == 0 or x%5 == 0):
            print("DENIED")
            exit()

print("APPROVED")

Solution (Python):
import numpy as np

n=int(input())
a=np.array(input().split()).astype(int)

a_g=(a%2==0)
a_35=(a[a_g]%3==0)+(a[a_g]%5==0)

if a_35.all():
	ans="APPROVED"
else:
	ans="DENIED"
print(ans)

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

flag = 0
even = list()

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

for i in even:
    if (i % 3 == 0 or i % 5 == 0):
        flag += 1

if(flag == len(even)):
    print('APPROVED')
else:
    print('DENIED')

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

for v in As:
    if v % 2 == 0 and not (v % 3 == 0 or v % 5 == 0):
        print("DENIED")
        exit(0)
print("APPROVED")

Solution (Python):


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

if any(True for x in As if x % 2 == 0 and not (x % 3 == 0 or x % 5 == 0)):
    print("DENIED")
else:
    print("APPROVED")

Solution (Python):

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

if any([x for x in As if x % 2 == 0 and not (x % 3 == 0 or x % 5 == 0)]):
    print("DENIED")
else:
    print("APPROVED")

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

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

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

Solution (Python):
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    N = ir()
    A = lr()
    for a in A:
        if a%2 == 0:
            if a%3 != 0 and a%5 != 0:
                print('DENIED')
                return
    print('APPROVED')
resolve()

Solution (Python):
import sys
from math import *
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

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

    for i in range(n):
        if As[i] % 2 == 0:
            if As[i] % 3 != 0 and As[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 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 = int(input())
num_list = list(map(int,input().split()))

sign = 0

for i in range(0,num):
  if num_list[i]%2 == 0:
    if not (num_list[i]%3 == 0 or num_list[i]%5 == 0):
      sign = 1

if sign == 0:
  ans = "APPROVED"
elif sign == 1:
  ans = "DENIED"
  
print(ans)

Solution (Python):
def nyukokushinsa(a):
  for a_i in a:
    if a_i % 2 == 0 and (a_i % 3 != 0 and a_i % 5 != 0):
      return 'DENIED'

  return 'APPROVED'

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

print(nyukokushinsa(a))

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
	n = INT()
	a = [x for x in LIST() if x%2 == 0]

	for x in a:
		if x % 3 != 0 and x % 5 != 0:
			break
	else:
		print("APPROVED")
		sys.exit()

	
	print("DENIED")


if __name__=='__main__':
	main()

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

sign = 0

for i in range(0,num):
  if num_list[i]%2 == 0:
    if not (num_list[i]%3 == 0 or num_list[i]%5 == 0):
      sign = 1

if sign == 0:
  ans = "APPROVED"
elif sign == 1:
  ans = "DENIED"
  
print(ans)

Solution (Python):
import sys
n = int(input()) 
l = list(map(int, input().split()))
def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False
for n in l:
  if is_even(n):
    if n % 3 == 0 or n % 5 == 0:
      pass
    else:
      print("DENIED")
      sys.exit()
print("APPROVED")

Solution (Python):
if __name__ == '__main__':

    n = int(input())
    a = [int(i) for i in input().split() if int(i) % 2 == 0]

    result = "APPROVED"
    for i in a:
        if i % 3 == 0 or i % 5 == 0:
            continue
        else:
            result = "DENIED"
            break
    print(result)

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

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

Solution (Python):
def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))


n = iinp()
a = lmiinps()

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

print("APPROVED")

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

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

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

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

dame =0

for x in l:
  if x%2 == 0:
    if (x%3 == 0) or (x%5 == 0):
      continue
    else:
      dame = dame +1   
  else:
    continue

if dame > 0:
  print("DENIED")
else:
  print("APPROVED")

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

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

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

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

Solution (Python):
import sys
import numpy as np
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 and a[i]%5 != 0:
            print("DENIED")
            sys.exit()
print("APPROVED")

Solution (Python):
n = int(input())
a_lst = [int(elem) for elem in input().split()]

res = 1
for a in a_lst:
  if a % 2 == 0:
    if a % 3 == 0 or a % 5 == 0:
      pass
    else:
      res = 0
      break
if res == 0:
  print("DENIED")
else:
  print("APPROVED")

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


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

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

Solution (Python):
N =int(input())
numbers =input().rstrip().split(" ")
evens=[]
for number in numbers:
    if int(number)%2==0:
        evens.append(number)
i=0

for even in evens:
    if (int(even)%3 != 0) and (int(even)%5 !=0):
        i=i+1

if i>0:
    print("DENIED")
elif i==0:
    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):
numInt = int(input())
inputNum = list(map(int, input().split()))
evenList = []

for i in range(numInt):
  if inputNum[i] % 2 == 0:
    evenList.append(inputNum[i])
  
  length = len(evenList)
 

flag = True

for i in range(length):
  if evenList[i] % 3 != 0 and evenList[i] % 5 != 0:
    flag = False 
    break

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

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().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 = list(map(int, input().split()))
isFail = False
for i in A:
    if i%2 == 0:
        if not (i%3 == 0 or i%5 == 0):
            isFail = True
if isFail:
    print('DENIED')
else:
    print('APPROVED')

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

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

check()

Solution (Python):
N = int(input())
lst = [int(x) for x in input().split()]
for x in lst:
    if x % 2 == 0:
        if x % 3 == 0 or x % 5 == 0:
            continue
        else:
            print("DENIED")
            exit()

print("APPROVED")

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 = list(map(int,input().split()))
num = [i for i in A if i % 2 == 0]
count = 0
for i in num:
    if i % 3 != 0 and i % 5 != 0:
        print('DENIED')
        count = 1
        break
if count == 0:
    print('APPROVED')

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

for i in range(len(a)):
    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 = int(input())
a = list(map(int,input().split()))
b = 0

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

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
c = 0
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] %3 != 0 :
            if A[i] %5 != 0:
                c = 1
                break
if c == 0:
    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')
            break
else:
    print('APPROVED')

Solution (Python):
Row=int(input()) 
List=[int(i) for i in input().split()]

flg=0
for Num in List:
  if Num % 2 == 0 and(Num  % 3 != 0 and Num % 5 != 0):
    flg = 1
    break

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

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

A = [i for i in A if i % 2 == 0]
odd = len(A)
A = [i for i in A if i % 3 == 0 or i % 5 == 0]
if odd == len(A):
    print("APPROVED")
else:
    print("DENIED")

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


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

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

approved = True

for i in A:
    if i % 3 != 0 and i % 5 != 0:
        approved = False

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

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

cnt = 0
for a in A:
    if a % 2 == 0:
        if a % 3 == 0:
            cnt += 1
        elif a % 5 == 0:
            cnt += 1
    else:
        cnt += 1
print('APPROVED' if N == cnt else 'DENIED')

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

Solution (Python):
N = int(input())
*A, = map(int, input().split())
print("APPROVED" if all(map(lambda x:x%3==0 or x%5==0, filter(lambda x:x%2==0, A))) else "DENIED")

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

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

Solution (Python):
n = int(input())
A = list(int(x) for x in input().split())

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

print(text)

Solution (Python):
N = input()
numList = input().split(' ')
for num in numList:
  num = int(num)
  if num % 2 == 0:
    judge1 = num % 3 == 0
    judge2 = num % 5 == 0
    approve = judge1 or judge2
    if not approve:
      print('DENIED')
      exit()
print('APPROVED')

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

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

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

Solution (Python):
n = int(input())
l = [int(i) for i in input().split()]
x = str()
for i in range(n):
  if (l[i] % 2 == 0 and (l[i] % 3 == 0 or l[i] % 5 == 0)) or l[i] % 2 == 1:
    x = 'APPROVED'
    continue
  else:
    x = 'DENIED'
    break
print(x)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
b = [0] * n
for i in range(n):
    if (a[i]%2 == 0) and (a[i]%3 != 0) and (a[i]%5 !=0):
        b[i] = 1
        print('DENIED')
        exit()
if sum(b) == 0:
    print('APPROVED')

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

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

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

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

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

Solution (Python):
n=input()
list=[int(x) for x in input().split()]
count=0
newlist=[int(x) for x in list if x%2==0]
s=[int(x) for x in newlist if x%3==0 or x%5==0]
if len(s)==len(newlist):
  print("APPROVED")
else:
  print("DENIED")

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

flag = 0

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      flag = 1
      break
    else:
      continue
      
if flag == 0:
  print('APPROVED')

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

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

Solution (Python):

import sys
n = int(sys.stdin.readline())
nums = map(int, sys.stdin.readline().split())

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

print(flag)

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")
        break
else:
    print("APPROVED")

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

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

Solution (Python):




def main():
    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(0)

    print('APPROVED')


if __name__ == "__main__":
    main()

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

flag = True
for i in range(len(a)):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[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()))

boo = False
for i in a:
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      boo = True

str = 'DENIED' if boo else 'APPROVED'
print(str)

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:
            flag = 0
        else:
            flag = 1
            break

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

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


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

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

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

Solution (Python):
def judgiment(number_num):
  flag = True
  for number in list(map(int, input().split())):
    if number % 2 == 0:
      if not (number % 3 == 0 or number % 5 == 0):
        flag = False
        return flag
        break
    else:
      continue
  return flag

if __name__ == "__main__":
  number_num = int(input())
  flag = judgiment(number_num)
  if flag == True:
    print("APPROVED")
  else:
    print("DENIED")

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

for i in range(len(el)):
    if el[i] % 3 == 0 or el[i] % 5 == 0:
        el[i] = True
    else:
        el[i] = False

if el.count(False):
    print("DENIED") 
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 or i%5 == 0:
            continue
        else:
            print('DENIED')
            exit()
print('APPROVED')

Solution (Python):
input();print(['DENIED','APPROVED'][all(i%3<1 or i%5<1 for i in map(int,input().split()) if i%2<1)])

Solution (Python):
input();print(['DENIED','APPROVED'][all([i%3<1 or i%5<1 for i in list(map(int,input().split())) if i%2<1])])

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

flag=0
gu=0  
for i in range(0,N):
    if A[i]%2==0:  
        gu+=1
        if A[i]%3==0 or A[i]%5==0:
            flag+=1
            
        else:
            continue
    
    else:
        continue

if flag==gu:
    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 A[i] % 3 == 0 or A[i] % 5 == 0:
			flag = True
		else:
			flag = False
			break
if flag == True:
	print("APPROVED")
else:
	print("DENIED")

Solution (Python):
num = input()
li = input().split()
judge = True

for li_num in li :
 if int(li_num) % 2 == 0:
  if not(int(li_num) % 3 == 0) and not(int(li_num) % 5 == 0) :
   judge = False
   break

if judge :
  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())
a = list(map(int, input().split()))

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

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

Solution (Python):
import numpy as np

n = int(input())
arrA = np.array(input().split(),dtype=np.int64)

filter = (arrA % 2 == 0)
if len(arrA[filter])==0:
    ans = "APPROVED"
else:
    for i in arrA[filter]:
        if i%3==0 or i%5==0:
            ans = "APPROVED"
        else:
            ans = "DENIED"
            break


print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


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

    for a in al:
        if a % 2 == 1:
            continue
        if a % 3 == 0:
            continue
        if a % 5 == 0:
            continue

        print('DENIED')
        return 

    print('APPROVED')
    return

if __name__ == '__main__':
    main()

Solution (Python):
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """5
6 7 9 10 31"""
        output = """APPROVED"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """3
28 27 24"""
        output = """DENIED"""
        self.assertIO(input, output)

def resolve():
    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")
            return
    print("APPROVED")


if __name__ == "__main__":
    resolve()

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

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

count = 0
for h in hoge:
    if h % 3 == 0 or h % 5 == 0:
        count = count + 1

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

Solution (Python):
def resolve():
    N = int(input())
    A_list = list(map(int, input().split()))   

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

    print("APPROVED")
 
if __name__ == "__main__":
    resolve()

Solution (Python):
def check(a):
    for x in a:
        if x%2 == 0:
            if x%3 == 0 or x%5 == 0:
                pass
            else:
                return False
    return True

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

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

Solution (Python):
def check(b):
    for x in b:
        if x%2 == 0:
            if x%3 == 0 or x%5 == 0:
                pass
            else:
                return False
    return True

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


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

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

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

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

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

print("APPROVED")

Solution (Python):
N=int(input())
b=input().split()
c=[]
for i in range(N):
  c.append(int(b[i]))
ans='APPROVED'
for j in c:
  if j%2==0:
    if not(j%3==0 or j%5==0):
    	ans='DENIED'
    	break
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 and a % 5 != 0:
            print("DENIED")
            exit()
print("APPROVED")

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

if all(a%3==0 or a%5==0 for a in A if a%2==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 or A[i] % 5 == 0:
            pass
        else:
            ans = "DENIED"
            break
    else:
        continue
print(ans)

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





res = 0
for ai in A :
  if ai % 2 ==0 :
    if (ai % 3 != 0) and (ai % 5 != 0):
      res += 1
      break

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