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.



Sample input:
5
6 7 9 10 31


Sample output:
APPROVED

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    import sys

    input = sys.stdin.readline

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

    denied = False

    for num in numbers:
        if num % 2 == 0 and num % 3 != 0 and num % 5 != 0 :
            denied = True
            print("DENIED")
            break

    if not denied :
        print("APPROVED")

resolve()

Submission status: Accepted

Solution code:
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    P = map(lambda a: a % 2 == 1 or (a % 3 == 0 or a %5 == 0), A)
    print('APPROVED' if all(P) else 'DENIED')

resolve()

Submission status: Accepted

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
p=True
for i in a:
  if i%2==0:
    if i%5!=0 and i%3!=0:
      print("DENIED")
      p=False
      break
if p==True:
  print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
AA = [x % 3 != 0 and x % 5 != 0 for x in A if x % 2 == 0]
if any(AA):
  print("DENIED")
else:
  print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
print('APPROVED') if all(i%3==0 or i%5==0 for i in a if i%2==0) else print('DENIED')

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
print('APPROVED') if all(i % 3 == 0 or i % 5 == 0 for i in a if i % 2 == 0) else print('DENIED')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

f = True
for a in a_l:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            print('DENIED')
            f = False
            break

if f:
    print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#整数の入力
N = int(input())

#複数の入力
input_list = input().split( )

counter = 0

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

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

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

print(app())

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd
# fractions.gcd() を用いること
# math.log2()はatcoderでは対応していない．留意せよ．

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

Bool = True

aintlist = input().split(" ")

alist=[]

for i in range(n):
    alist.append(int(aintlist[i]))

for i in range(n):
    if alist[i]%2==0 and not(alist[i]%3==0 or alist[i]%5==0):
        Bool = False

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

Submission status: Accepted

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

flag=True
for a in A:
    if a%2==0:
        if (a%3!=0)&(a%5!=0):
            flag=False
            break

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
aa = [int(i) for i in input().split()]

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
l=map(int,input().split())
for i in l:
    if i%2==0 and not(i%3==0 or i%5==0):
        print('DENIED')
        exit(0)
print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
for x in A:
  if x % 2 != 1 and x % 6 != 0 and x % 10 != 0:
    print ("DENIED")
    break
else:
  print ("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


YES = "APPROVED"
NO = "DENIED"

def solve(N: int, A: "List[int]"):
    for a in A:
        if a % 2 == 0 and a % 3 != 0 and a % 5 != 0:
            print(NO)
            return
    print(YES)

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))
    A = [int(next(tokens)) for _ in range(N)]
    solve(N, A)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():

    N = int(input())
    A = list(map(int, input().split()))
    for v in A:
        if v % 2 == 0 and (v % 5 != 0 and v % 3 != 0): return "DENIED"
    return "APPROVED"

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

Submission status: Accepted

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

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

flag = True

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

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

Submission status: Accepted

Solution code:

if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    ev = [e for e in a if e % 2 == 0]
    c = [e for e in ev if e % 3 == 0 or e % 5 == 0]
    print('APPROVED' if len(ev) == len(c) else 'DENIED')

Submission status: Accepted

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

Submission status: Accepted

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

c = True
for i in l:
    if i % 2 == 0:
        if (i%3 == 0) or (i%5 == 0):
            continue
        
        else:
            c = False
    
if c:
    print('APPROVED')

else:
    print('DENIED')

Submission status: Accepted

Solution code:
N = int(input())
Alist = list(map(int,input().split()))
ans = 'APPROVED'
for a in Alist:
  if a%2 == 0 :
    if not(a%3 == 0) and not(a%5 == 0):
      ans = 'DENIED'
      break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
l_in = list(map(int, input().split()))
ans = 'APPROVED'

for i in l_in:
  if i % 2 == 0 and not (i % 6 == 0 or i % 10 == 0):
    ans = 'DENIED'

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = True
for num in A:
  if num%2==0:
    if not(num%3==0 or num%5==0):
      ans = False
      break
      
if ans:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
aeve = map(lambda x: x if x % 2 == 0 else 0, a)
ad35 = map(lambda x: True if x % 3 == 0 or x % 5 == 0 else False, aeve)
print("APPROVED") if all(ad35) else print("DENIED")

Submission status: Accepted

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

output = 'APPROVED'
for n in A:
    if (n % 2 == 0) and (n % 6 != 0) and (n % 10 != 0):
        output = 'DENIED'
        
print(output)

Submission status: Accepted

Solution code:
# import math
# import bisect
# import heapq
# from collections import deque
# import numpy as np

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

ans = 'APPROVED'
for i in range(n):
    b = a[i]
    if b%2==0 and not(b%3==0 or b%5==0):
        ans = 'DENIED'

print(ans)

Submission status: Accepted

Solution code:
def main():
    n = int(input())

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n  = int(input())
A = list(map(int,input().split()))
ans = []
A_even = [i for i in A if i % 2 == 0]
for i in A_even:
  if i % 3 == 0 or i % 5 == 0:
    ans.append(i)
if len(ans) == len(A_even):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = True
for i in A:
    if i%2 == 0:
        if i%3 == 0 or i%5 == 0:
            continue
        else:
            ans = False
print("APPROVED" if ans==True else "DENIED")

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
count=0
for i in a:
    if i%2==0:
        if i%3!=0 and i%5!=0:
            count+=1
            break
if count==0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-

def solve():
    N = int(input())
    As = list(map(int, input().split()))
    for a in As:
        if a%2==0:
            if a%3==0 or a%5==0:
                continue
            else:
                print("DENIED")
                return
    print("APPROVED")


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
for ai in a:
    if ai % 2 == 1: continue
    else:
        if ai % 3 == 0 or ai % 5 == 0: continue
        else:
            print("DENIED")
            exit()
print("APPROVED")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
TorF = True

for i in range(N):
  if A[i]%2==0 and not (A[i]%3==0 or A[i]%5==0):
    TorF = False
    break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
result = 'APPROVED'
for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            pass
        else:
            print('DENIED')
            exit()

print(result)

Submission status: Accepted

Solution code:
num = int(input())
a = list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
ans='DENIED'
for i in range(len(a)):
    if(a[i]%2==0):
        b.append(a[i])
f=0
for i in range(len(b)):
    if((b[i]%3==0)|(b[i]%5==0)):
        f+=1
if(f==len(b)):
    ans='APPROVED'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
number = list(map(int, input().split()))

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

for j in box:
    if j % 3 ==0:
        continue
    elif j % 5 ==0:
        continue
    else:
        print("DENIED")
        exit()
else:
    print("APPROVED")

Submission status: Accepted

Solution code:
N = input()
X = [x for x in list(map(int, input().split())) if x % 2 == 0]
Y = [y for y in X if y % 3 == 0 or y % 5 == 0]
print('APPROVED' if len(X) == len(Y) else 'DENIED')

Submission status: Accepted

Solution code:
_=input()
*l,=map(int,input().split())
s='APPROVED'
for i in l:
  if i%2==0 and i%3!=0 and i%5!=0:
    s='DENIED'
print (s)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
result = "APPROVED"
for an in a:
    if an % 2 == 0:
        if an % 3 != 0 and an % 5 != 0:
            result = 'DENIED'
            break

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = 1
for a in A:
    if not a % 2 and a % 3 and a % 5:
        print("DENIED")
        exit()
print("APPROVED")

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
even_count = 0
ans_count = 0
for a in A:
    if a%2==0:
        even_count += 1
        if a%3==0 or a%5==0:
            ans_count+=1

        else:
            print('DENIED')
            break
if even_count == ans_count:
    print('APPROVED')

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
ans=0
for x in range(N):
    if A[x]%2==0:
        if A[x]%3==0 or A[x]%5==0:
            ans+=1
    elif A[x]%2!=0:
        ans+=1
if ans==N:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
n = int(input())
alist = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
c=[]
ans="DENIED"
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 or b[i]%5==0:
		c.append(b[i])  
if len(b)==len(c):
  ans="APPROVED"
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
li=list(map(int,input().split()))
even=[]
ans="APPROVED"

for i in li:    
  if i%2==0:
    even.append(i)
    
for j in even:
  if j%3!=0 and j%5!=0:
    ans="DENIED"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = (input().split())
i_count = 0
test = []
for i in A:
  num = int(i) % 2
  if num == 0 :
    test.append(i)

for i in test:
  num3 = int(i) % 3
  num5 = int(i) % 5
  if num3 == 0 or num5 ==0:
    i_count += 1

if i_count == len(test):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

Solution code:
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"
    else:
        pass

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
# a, b, c = map(int, input().split())
evens = []
judge = True
for a in A:
    if a % 2 == 0:
        evens.append(a)
for even in evens:
    if even % 3 != 0 and even % 5 != 0:
        judge = False
print("APPROVED") if judge else print("DENIED")

Submission status: Accepted

Solution code:
N=int(input())
document=list(map(int,input().split()))
document_even=[i for i in document if i%2==0]
for number in document_even:
    if number%3!=0 and number%5!=0:
        print("DENIED")
        exit()
print("APPROVED")

Submission status: Accepted

Solution code:
def listint():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

n = listint()[0]
a = listint()
able = True
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            able = False
if able == True:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))

for a_n in a:
    if a_n % 2 == 0:
        if a_n % 3 == 0 or a_n % 5 == 0:
            continue
        else:
            print('DENIED')
            break
else:
    print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3


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

Submission status: Accepted

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

Submission status: Accepted

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


a2 = [x for x in a if x % 2 == 0]
if len(a2) == 0: # 偶数ない
    print("APPROVED")
    exit()

a3 = [x for x in a2 if x % 3 == 0 or x % 5 == 0]
if len(a3) == len(a2): # 偶数の数と3,5の倍数の数が一致
    print("APPROVED")
    exit()

print("DENIED")

Submission status: Accepted

Solution code:
import sys
n=int(input())
a = list(map(int,input().split())) 
flg=True
for i ,item in enumerate(a):
    if not(item&1): 
        if(item%3==0 or item % 5==0):
            continue
        else:
            flg=False
        
if flg:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

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


def judge(A):
    for a in A:
        if (a % 2 != 0):
            continue
        if ((a % 3 == 0) or (a % 5 == 0)):
            continue
        else:
            return 'DENIED'
    return 'APPROVED'


print(judge(A))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
v = list(map(int,input().split()))
flag = True
for i in v:
  flag = flag and (i % 2 == 1 or i % 3 == 0 or i % 5 == 0)
print("APPROVED" if flag else "DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
check=True
for num in l:
    if num%2==0 and not (num%3==0 or num%5==0):
        check=False
if check:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
N=int(input())
print('DENIED' if any([x%2==0 and (x%3 and x%5) for x in map(int,input().split())]) else 'APPROVED')

Submission status: Accepted

Solution code:
N=input();print('DENIED'if any([x%2==0 and(x%3 and x%5)for x in map(int,input().split())])else'APPROVED')

Submission status: Accepted

Solution code:
n = int(input())
an = [int(i) for i in input().split()]

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

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

Submission status: Accepted

Solution code:
N=int(input())
print('DENIED' if any([x%2==0 and (x%3 and x%5) for x in map(int,input().split())]) else 'APPROVED')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

for c in chkList:
  if c%2 == 0 and c % 6 != 0 and c % 10 != 0:
    print('DENIED')
    sys.exit()

print('APPROVED')

Submission status: Accepted

Solution code:
a=int(input())
b=list(map(int,input().split()))
t=0
for i in b:
	if i % 2 ==0 and i % 3 != 0 and i % 5 != 0:
		t=t+1
if t>0:
	print('DENIED')
else:
	print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    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:
                return 'DENIED'

    return ans

print(solve())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = [int(i) for i in input().split()]
for i in A:
  if i%2 == 0 and (not i%3 == 0 and not i % 5 == 0):
    print("DENIED")
    sys.exit()
  else :
    continue
print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def main():
    n = int(input())
    As = list(map(int, input().split()))
    for A in As:
        if A % 2 != 0:
            continue
        if A % 3 == 0 or A % 5 == 0:
            continue
        print("DENIED")
        sys.exit(0)
    print("APPROVED")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
a = np.array([int(x) for x in input().split()])

aa = a[a%2 == 0]
if np.all((aa%3 == 0) | (aa%5 == 0)):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
a = np.array([int(x) for x in input().split()])

aa = a[a%2 == 0]
aaa = aa[(aa%3 == 0) | (aa%5 == 0)]

if len(aa) == len(aaa):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
N = int(input())
Liste = [a for a in map(int,input().split()) if a % 2 == 0 and (a%3 != 0 and a%5 != 0)]
if len(Liste) == 0:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

Solution code:
ans = 'APPROVED'

N = int(input())
A = input().split()

for i in range(N):
    if (int(A[i])%2 == 0) and (int(A[i])%3 != 0) and (int(A[i])%5 != 0):
        ans = 'DENIED'
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
li = [int(i) for i in input().split()]

is_approved = True
for l in li :
    if (l % 2 != 0) :
        continue

    if (l % 3 == 0 or l % 5 == 0) :
        continue

    is_approved = False
    break

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

Submission status: Accepted

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