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

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
flag = 1
for num in A:
    if num % 2== 0:
        if num % 3 ==0 or num % 5 ==0:
            continue
        else:
            flag =0

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

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

evens = [i for i in Papers if i %2==0]

flg = 0

for j in evens:
    if j%3==0 or j%5==0:
        flg += 0
    else:
        flg+=1

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

Solution (Python):
import sys

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')
			sys.exit()

print('APPROVED')

Solution (Python):
n = int(input())
li = list(map(int,input().split()))
lie = [i for i in li if i % 2 == 0]
for i in range(len(lie)):
    if lie[i] % 3 == 0 or lie[i] % 5 == 0:
        pass
    else :
        print("DENIED")
        exit()
print("APPROVED")

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

for i in range(n):
  if a[i]%2==0:
    if a[i]%3==0 or a[i]%5==0:
        continue
    else:
      ans='DENIED'
      break
  else:
    continue
print(ans)

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

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

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

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
print("APPROVED" if cnt1 == cnt2 else "DENIED")

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

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

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

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

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

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

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

Solution (Python):
INT_MAX=10**11+7
MOD=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]

import math as M
n=int(input())
bool=True
A=INPUT()
for i in range(n):
    if A[i]%2==0:
        if A[i]%3==0 or A[i]%5==0:
            continue
        bool=False
        break
if bool:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
n = int(input())
a = input().split()
even = []
even_counter = 0
div = 0
 
for i in a:
  int_a = int(i)
  if int_a % 2 == 0:
    even.append(int_a)
    even_counter += 1
 
for i in range(even_counter):
  if int(even[i]) % 3 == 0 or int(even[i]) % 5 == 0:
    div += 1
 
if div == even_counter:
  print("APPROVED")
else:
  print("DENIED")

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

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

print("APPROVED")

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

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

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

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

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

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

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

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

print('APPROVED')

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

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

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

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

even_nums = [int(num) for num in input().split() if int(num) % 2 == 0]
approve_nums = [num for num in even_nums if any([num % 6 == 0, num % 10 == 0, num % 30 == 0])]
print('APPROVED') if len(approve_nums) == len(even_nums) else print('DENIED')

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

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

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

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

cou = 0
ans = 0
for i in A:   
    if i % 2 == 0:
        cou += 1
        if i % 3 == 0 or i % 5 == 0:
            ans += 1

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

Solution (Python):
import numpy as np
n = int(input())
a = np.array(input().split(),dtype=int)

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

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

Solution (Python):
def solve():
    for ai in a:
        if ai % 2 == 0 and (not (ai % 3 == 0 or ai % 5 == 0)):
            print("DENIED")
            exit()
    print("APPROVED")


n = int(input())
a = [int(s) for s in input().split(" ")]
solve()

Solution (Python):

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

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

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

B=[]
for a in A:
  if a%2==0:
    B.append(a)
    
cnt=0
for b in B:
  if (b%3==0 or b%5==0):
    continue
  else:
    cnt=1
    
if cnt==0:
  print("APPROVED")
else:
  print("DENIED")

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

Solution (Python):
import sys
n = int(sys.stdin.readline().rstrip())
li = list(map(int, sys.stdin.readline().split()))
flag = True
for i in li:
  if not i % 2:
    if i % 3 and i % 5:
      flag = False
print('APPROVED' if flag else 'DENIED')

Solution (Python):

import sys
from collections import Counter
from itertools import permutations, combinations
from fractions import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

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

if __name__ == '__main__':
    main()

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

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

l_1 = []
l_2 = []
for i in L:
    if i%2 == 0:
        l_1.append(i)
for i in l_1:
    if i%3 == 0 or i%5 == 0:
        l_2.append(i)
if len(l_1) == len(l_2):
    print("APPROVED")
else:
    print("DENIED")

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

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

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

print("APPROVED")

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

Solution (Python):


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

if all(i%3 == 0 or i%5 == 0 for i in A_even):
    print("APPROVED")
else:
    print("DENIED")

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

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

Solution (Python):

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

B = [0 for _ in range(N)]

count = 0

for i in range(N):
  if A[i] % 2 == 0:
    B[i] = A[i]
    count += 1

C = [i for i in B if i != 0]

flag = 0
for i in range(count):
  if C[i] % 3 != 0 and C[i] % 5 != 0:
    flag += 1
if flag == 0:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
import sys
N = input()
As = [int(n) for n in input().split()]

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

print('APPROVED')

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
'''
おぐに聞く
a_list = []
'''
a_count = 0
count = 0

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

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

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

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

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

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

Solution (Python):
n = int(input())
a = input()
b = a.rstrip().split()
d = 0
for e in b:
  c = int(e)
  if c%2 == 0:
    if c%3 != 0 and c%5 != 0:
      d += 1
if d == 0:
  print('APPROVED')
else:
  print('DENIED')

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

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
f = True
for i in range(len(A)):
    if A[i]%2 == 0:
        if A[i]%3 == 0 or A[i]%5 == 0:
            continue
        else:
            f = False

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

Solution (Python):
import sys

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

Solution (Python):
def check(n):
    if (n%3==0) | (n%5==0):
        return 0
    else:
        return n

n = int(input())
s = list(map(int, input().split()))
p = [i for i in s if i%2 == 0]
q = map(check,p)

if sum(q)==0:
    print("APPROVED")
else:
    print("DENIED")

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

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
ans = True
for x in A:
    if x & 1 == 0:
        if x % 3 != 0 and x % 5 != 0:
            ans = False
            break
print('APPROVED' if ans else 'DENIED')

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

for i in A:
    if i%6==0 or i%10==0 or i%2 == 1:
        continue
    else:
        print('DENIED')
        exit()

print('APPROVED')

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

Solution (Python):

n = int(input())
a = input().split()
even = []
even_counter = 0
div = 0
 
for i in a:
  int_a = int(i)
  if int_a % 2 == 0:
    even.append(int_a)
    even_counter += 1
 
for i in range(even_counter):
  if int(even[i]) % 3 == 0 or int(even[i]) % 5 == 0:
    div += 1
 
if div == even_counter:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):


def main():
    *A, = map(int, open(0).read().split())
    N = A[0]
    A = A[1:]

    C = []
    B = [i for i in A if i % 2 == 0]
    for i in B:
        if (i % 3 == 0 or i % 5 == 0):
            C.append(0)
        else:
            C.append(1)
    
    if sum(C) == 0:
        print("APPROVED")
    else:
        print("DENIED")



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')
      break
  if(i==N-1):
    print('APPROVED')

Solution (Python):
n = int(input())
a = input().split()
even = []
even_counter = 0
div = 0

for i in a:
  int_a = int(i)
  if int_a % 2 == 0:
    even.append(int_a)
    even_counter += 1

for i in range(even_counter):
  if int(even[i]) % 3 == 0 or int(even[i]) % 5 == 0:
    div += 1

if div == even_counter:
  print("APPROVED")
else:
  print("DENIED")

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 and a%5 != 0:
			print("DENIED")
			sys.exit()

print("APPROVED")

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
flag = True
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            continue
        else:
            flag = False
            break

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

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

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

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

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

Solution (Python):
N = 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:
      continue
    else:
      Flag = False

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

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

a = 0
b = 0
for c in l:
    if c%2 == 0:
        a += 1
        if (c%3 == 0) or (c%5 == 0):
            b += 1
        else:
            pass 
    else:
        pass
        
if a == b:
    print("APPROVED")
else:
    print("DENIED")

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

A_even = [x for x in A if x%2 == 0]
ans = 'APPROVED'
for i in A_even:
    if i%3 == 0 or i%5 == 0:
        ans = 'APPROVED'
    else:
        ans = 'DENIED'
        break
print(ans)

Solution (Python):

import math


n = int(input())
numbers = input().split()


text = "APPROVED"


for i in numbers:
    if (int(i) % 2 == 0) and (int(i) % 3 != 0) and (int(i) % 5 != 0):
        text = "DENIED"
        break


print(text)

Solution (Python):
n=int(input())
l=[]
a=[]
b=[]
for i in range(n):
    m=[int(j) for j in input().split()]
    
    for k in m:
        if k%2==0:
            l.append(k)
    
    for p in l:
        if p%3==0 or p%5==0:
            a.append(p)
        else:
            b.append(p)
 
    if len(a)==len(l):
        print("APPROVED")
    else:
        print("DENIED")
    break

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 = [int(s) for s in input().split()]

result = 'APPROVED'

for n in A:
    if n % 2 == 0:
        if n % 3 != 0 and n % 5 != 0:
            result = 'DENIED'
            break

print(result)

Solution (Python):
import sys
x = int(input())
num = list(map(int, input().split()))
test = []
count = 0

for i in num:
  if(i % 2 == 0):
    test.append(i)

for i in test:
  if(i % 3 != 0 and i % 5 != 0):
    print('DENIED')
    count += 1
    sys.exit()

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

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

for i in range(l):
    if List[i]%2!=0:
        count+=1
    elif List[i]%2==0:
        if List[i]%3==0 or List[i]%5==0:
            count+=1

if count==len(List):
    print("APPROVED")

else:
    print("DENIED")

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

flag = True

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

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

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

main()

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)==False:
            flag=False
if flag:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):

url = "https://atcoder.jp//contests/abc155/tasks/abc155_b"

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

    for val in t:
        if val % 2 == 0:
            flg = False
            if val % 3  == 0:
                flg = True
            elif val % 5  == 0:
                flg = True

            if not flg:
                print('DENIED')
                exit()
    print('APPROVED')
    exit()


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
try:
  a = list(map(int,input().split()))
  a1 = list(i for i in a if i%2==0)
  a2 = list(i for i in a1 if i%3!=0)
  a3 = list(i for i in a2 if i%5!=0)
except EOFError:
  pass
if len(a3) == 0:
  print('APPROVED')
else:
  print('DENIED')

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

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

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

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

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

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

cnt = 0
for b in B:
  if b%3 == 0 or b%5 == 0:
    cnt += 1
if cnt == len(B):
  print('APPROVED')
else:
  print('DENIED')

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



isFlg = True

for val in line:
    if val %2 == 0:

        if val % 3  != 0 and  val % 5  != 0:
            isFlg = False

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

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

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

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

Solution (Python):
n=input()
for a in map(int,input().split()):
  if a % 2 == 0:
    if not (a%3==0 or a%5==0):
      print("DENIED")
      exit()   
print("APPROVED")

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

nums = input().rstrip().split(' ')

even_num = []
for i in range(N):
    if int(nums[i]) % 2 == 0:
        even_num.append(int(nums[i]))

count = 0
for j in range(len(even_num)):
    if int(even_num[j]) % 3 == 0 or int(even_num[j]) % 5 == 0:
        count += 1

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

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

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

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

approve = True

for a in A_list:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            approve = False
            break

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

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


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


data = read()
flag = True
for i in data:
    if (i % 2 == 0):
        if (i % 3 != 0 and i % 5 != 0):
            flag = False
            break
if (flag == True):
    print('APPROVED')
else:
    print('DENIED')

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

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

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

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

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

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

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

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
broke = False
for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 6 != 0 and A[i] % 10 != 0:
            print('DENIED')
            broke = True
            break
if broke == False:
    print('APPROVED')

Solution (Python):
from collections import deque, Counter as cnt
from collections import defaultdict as dd
from operator import itemgetter as ig
from bisect import bisect_right as bsr
from math import factorial, ceil, floor
import sys
sys.setrecursionlimit(1000000)


args = None
INF = float("inf")
MOD = int(1e9 + 7)


def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]


def nlist(n, v):
    if not n:
        return [] if type(v) is list else v
    return [nlist(n[1:], v) for _ in range(n[0])]


def yesno(v, yes="Yes", no="No"):
    print([yes, no][not v])


def main():
    """エントリーポイント"""
    N = input(int)
    A = input([int, N])
    yesno(all([a % 2 == 1 or (a % 3 == 0 or a % 5 == 0)
               for a in A]), "APPROVED", "DENIED")


if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    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 or a[i] % 5 == 0:
            continue
        else:
            print('DENIED')
            exit(0)
print('APPROVED')

Solution (Python):

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


ans = True
for a in A:
    if( a%2 == 0 ):
        mod3 = a%3
        mod5 = a%5
        if( mod3 == 0 or mod5==0 ):
            continue
        else:
            ans = False


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

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

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

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

Solution (Python):
def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    a_list = [a for a in a_list if a % 2 == 0]
    ans = 'APPROVED'
    for a in a_list:
        if a % 3 != 0 and a % 5 != 0:
            ans = 'DENIED'
            break
    print(ans)

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

Solution (Python):


import sys



















def main():
    mod = 1000000007                  
    inf = float('inf')
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():  return int(input())
    def mi():  return map(int, input().split())
    def mi_0(): return map(lambda x: int(x)-1, input().split())
    def lmi(): return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():  return list(input())
    
    
    _ = ii()
    L = lmi()
    print('APPROVED') if all(map(lambda x: x%2==1 or x%6==0 or x%10==0, L)) else print('DENIED')

if __name__ == "__main__":
    main()

Solution (Python):
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    A = il()
    print('APPROVED' if all([a % 3 == 0 or a % 5 == 0 for a in A if a % 2 == 0]) else 'DENIED')


if __name__ == '__main__':
    main()

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

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

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

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

for i in range(len(b)):
    if b[i] % 3 != 0 and b[i] % 5 != 0:
        print('DENIED')
        exit()

print('APPROVED')

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

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

print("APPROVED")

Solution (Python):
n=int(input())
nums=list(map(int,input().split()))
permit=True
for num in nums:
  if num % 2==0:
    if num % 3 !=0 and num % 5 != 0:
      permit=False
  else:
    pass
if permit:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
import sys
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()
A = rl()

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