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: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

Solution code:
import sys
n = input()
arr = [int(_) for _ in input().split()]
flag = 1

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

if flag:
  print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = int(input())

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

isOk = False
for i in A:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            isOk = True
        else:
            isOk = False
            break


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

Submission status: Wrong Answer

Solution code:
N = input()
As = input().split(" ")

judge = True
gucount=0

for A in As:
    A=(int)(A)
    if A %2 ==0:
        gucount+=1
        if A%3 != 0 and A%5 != 0:
            judge=False
            break
if gucount ==0:
    judge=False

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

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
even=[]
for a in A:
    if a%2==0:
        even.append(a)
    else:
        print("APPROVED")
        exit()

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

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

Submission status: Wrong Answer

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

answer=""

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split(" ")))
b = []
flag = True
for i in a:
  if (i%2==0):
    b.append(i)
for k in b:
  if not (k%3==0 or k%5==0):
    flag == False
if flag:
  print("APPROVED")
else:
  print("DEFINED")

Submission status: Wrong Answer

Solution code:
n = int(input())
items = [int(x) for x in input().split()]

flg = False
for item in items:
  if item % 2 == 0:
    if item % 3 == 0 or item % 5 == 0:
      flg = True
    else:
      flg = False
      break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(e) for e in input().split()]
flag = True
for i in range(0,n):
    if a[i] % 2 == 0 and (a[i] % 3 != 0 and a[i] % 5 != 0):
        flag = False
if flag:
    print("APPROVE")
else:
    print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

box=[]
for i in range(n):
    if a[i]%2==0:
        box.append(a[i])
    
for i in range(len(box)):
    if box[i]%3==0 or box[i]%5==0:
        if i == len(box)-1:
            print('APPROVED')
    else:
        print('DENIED')
        break

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(s) for s in input().split()]
evenA = [i for i in A if i%2 == 0]
flg = True
for i in evenA:
  if i%3 != 0 and i%5 != 0:
    flg == False
if flg:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

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

print("APPROVED")

Submission status: Wrong Answer

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

s = "APPRPVED"

for i in A:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            s = "DENIED"

print(s)

Submission status: Wrong Answer

Solution code:
from sys import exit

N = int(input())
A = tuple(map(int, input().split()))
for a in A:
    if a % 2 == 0:
        if not(a % 3 != 0 or a % 5 != 0):
            print('DENIED')
            exit()
print('APPROVED')

Submission status: Wrong Answer

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

aa = filter(lambda num: True if num % 2 == 0 else False, a)
for num in aa:
    if (num // 3 != 0) and (num // 5 != 0):
        ans = 'DENIED'

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

judge = 'DENIED'

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

print(judge)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
OK = 0
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:
            OK = 1
        else:
            OK = 0
            break
if OK == 1:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
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=1
      break
if flag==1:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Wrong Answer

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

a_list_even = [i for i in a_list if i % 2 == 0]

for a in a_list_even:
    if a % 3 == 0 or a % 5 == 0:
        pass
    else:
        print("DENIDE")
        exit()

print("APPROVED")

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
even=[]
for a in A:
    if a%2==0:
        even.append(a)

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ok = True
for x in a:
    if x %2 == 0:
        if x %3!=0 and x %5 != 0:
            ok = False
            break
if ok:
    print("APPROVED")
else:
    print("DENINED")

Submission status: Wrong Answer

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

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

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

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

Submission status: Wrong Answer

Solution code:
import sys

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

f = True
for A in As:
    if A // 2 == 0 and not (A // 3 == 0 or A // 5 == 0):
        f = False
        break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print('DENIED')

Submission status: Wrong Answer

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

flag = False
for i in range(N):
  if nums[i]%2 == 0:
    continue
  elif nums[i]%3 == 0:
    continue
  elif nums[i]%5 == 0:
    continue
  else:
    print('DENIED')
    flag = True
    break
if flag == False:
  print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())

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

for i in range(n):
  if n % 2 != 0:
    continue
  else:
    if n % 3 == 0 or n % 5 == 0:
      print('DENIED')
      sys.exit()
      

print('APPROVED')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N=int(input())
A=list(map(int,input().split()))
Flg=True
for i in range(N):
    if A[i]%2==0:
        if A[i]%3==0 or A[i]%5==0:
            pass
        else:
            Flg=False
            print('DENIED')
    #else:
        #cnt+=1

if Flg:
    print('APPROVED')

Submission status: Wrong Answer

Solution code:
n, *a = map(int, open(0).read().split())
flag = False
for i in range(n):
    if a[i]%2==0:
        if i%3 and i%5: flag = True
if flag==False: print("APPROVED")
else: print("DENIED")

Submission status: Wrong Answer

Solution code:
n=int(input())

# s=input()

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

a=list(map(int,input().split()))
flg=False
for i in a:
    if i%2==0:
        if not (i%3==0 or i%5==0):
            flg=False;break
        else:
            flg=True
    


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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(zz) for zz in input().split()]

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

print('APPROVED')

Submission status: Wrong Answer

Solution code:
from sys import exit

N = int(input())
A = tuple(map(int, input().split()))
for a in A:
    if not a % 2 and a % 3 and a % 5:
        print('DENIED')
        exit()
print('ACCEPTED')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = input()
X = set(map(int, input().split()))
E = [x for x in X if x % 2 == 0]
EE = [e for e in E if (e % 3 == 0 or e % 5 == 0)]
if len(E) == len(EE):
    print("APPLOVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

result = ''

for a in a_list:
  if a%2 == 0:
    if a%3 == 0 or a%5 == 0:
      result = 'APPROVED'
    else:
      result = 'DENIED'
      break

print(result)

Submission status: Wrong Answer

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

ans = 'APPROVED'
for a in A:
  if a%1 == 0:
    continue
  else:
    if a%3 == 0:
      continue
    elif a%5 == 0:
      continue
    else:
      ans = 'DENIED'
      
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
f = True
for i in a:
    if i % 2:
        continue
    elif i % 3 != 0 or i % 5 != 0:
        f = False
        break

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

Submission status: Wrong Answer

Solution code:
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
print(['APPROVED','DENIED'][flag])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
fl = True
for i in A:
    if i&1:
        continue
    else:
        if i%3!=0 or i%5!=0:
            fl = False
            break

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

Submission status: Wrong Answer

Solution code:
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 or a[i] % 5 == 0:
      continue
    else:
      print("DENIED")
      break
    if i == n-1:
      print("APPROVED")
    continue
  else:
    if i == n-1:
      print("APPROVED")
    continue

Submission status: Wrong Answer

Solution code:
input()
v = list(map(int, input().strip().split()))
if all(i & 1 or i % 3 or i % 5 for i in v): print('APPROVED')
else: print('DENIED')

Submission status: Wrong Answer

Solution code:
def check(n, da):
    for i in da:
        if i%2 == 0:
            if not(i%3 == 0 or n%5 == 0):
                return False
    return True


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

if check(n, da):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 10**7+9
inf = 10**20

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

n = I()
a = LI()

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from sys import setrecursionlimit as srl; srl(10**7)
rr = lambda: int(raw_input())
rrm = lambda: map(int, raw_input().split())

YES,NO = "APPROVED","DENIED"
def solve(N, A):
    for x in A:
        if x % 2 == 0:
            if x % 3 or x % 5:
                return NO
    return YES

    
print solve(int(rr()), rrm())

Submission status: Wrong Answer

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
from sys import exit
n = int(input())
a = list(map(int, input().split()))
b = "APPROVED"
while b == "APPROVED":
  for i in a:
    if i % 2 == 0:
      if (i % 3 == 0 or i % 5 == 0):
        b = "APPROVED"
      else:
        print("DENIED")
        exit()
  
print(b)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = "APPROVED"
while b == "APPROVED":
  for i in a:
    if i % 2 == 0:
      if (i % 3 == 0 or i % 5 == 0):
        b = "APPROVED"
      else:
        b = "DENIED"
        break
print(b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")
        exit()
print("APPROVED")

Submission status: Accepted

Solution code:
n = int(input())
A = map(int, input().split())
flag = True

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

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

Submission status: Accepted

Solution code:
import sys

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

for num in A:
    if num % 2 == 0:
        if not (num % 3 == 0 or num % 5 == 0):
            print("DENIED")
            sys.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 and i % 5 :
            print("DENIED")
            exit(0)

print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

mod_check=0
mod_check_ =0

for i in l:
    if i % 2 == 0 :
        mod_check += 1
        if i % 3 == 0 or i % 5 == 0:
            mod_check_ += 1
        else:
            pass
    else:
        pass

print('APPROVED') if mod_check==mod_check_ else print('DENIED')

Submission status: Accepted

Solution code:


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

else:
    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 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 range(n):
	if a[i]%2==0:
		if a[i]%3==0 or a[i]%5==0:
			b=1

		else:
			print("DENIED")
			break
else:
	print("APPROVED")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int , input().split()))
even = []
count = 0

for i in a:
    if i%2 == 0:
        even.append(i)

for i in even:
    if i%3 == 0 or i%5 == 0:
        count += 1

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
j = 0
for i in A:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            pass
        else:
            j += 1
    else:
        pass
if j > 0:
    print('DENIED')
else:
    print('APPROVED')

Submission status: Accepted

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

even = []
approved = 0

for i in A:
    if i % 2 == 0:
        even.append(i)

for x in even:
    if x % 3 == 0 or x % 5 == 0:
        approved += 1

if approved == len(even):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, *a = map(int, open(0).read().split())
print("DENIED" if sum((i % 3) * (i % 5) for i in a if i % 2 == 0) else "APPROVED")

Submission status: Accepted

Solution code:
import numpy as np

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

A = A[A%2==0]
if (np.all((A%3==0) | (A%5==0))==True):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

Solution code:
# 155_b
N=int(input())
A=input().split()
result=''
for i in range(N):
    A[i]=int(A[i])
    if A[i]%2==0:
        if A[i]%3!=0 and A[i]%5!=0:
            result = 'DENIED'
            break
    else:
        result='APPROVED'
print(result)

Submission status: Accepted

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

for i in range(N):
    if A[i]%2 == 0:
        count += 1
        if A[i]%3==0 or A[i]%5==0:
            okey += 1

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
a_ = [i for i in a if i % 2 == 0]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

list3=[]
for j in list2:
    if j%3==0 or j%5==0:
        list3.append(j)
    else:
        continue

x=len(list2)
y=len(list3)

if x==y:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

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

Submission status: Accepted

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

result = 'APPROVED'
for anum in anums:
    if (anum % 2 == 0) and not ((anum % 3 == 0) or (anum % 5 == 0)):
        result = 'DENIED'
        break

print(result)

Submission status: Accepted

Solution code:
N = int(input())
A = input().split()
num_even = 0
num_approved = 0

for i in range(N):
    if int(A[i]) % 2 == 0:
        num_even += 1
        if int(A[i]) % 3 == 0 or int(A[i]) % 5 == 0:
            num_approved += 1

if num_even == num_approved:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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 and i % 5 != 0:
                return ("DENIED")
    return ("APPROVED")

print(main())

Submission status: Accepted

Solution code:
N = int(input())


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


ok_list = []
ng_list = []

for i in num:
    if i % 2 == 1:
        ok_list.append(i)

    elif i % 3 == 0 or i % 5 == 0:
        ok_list.append(i)

    else:
        ng_list.append(i)

if not ng_list:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
for item in A:
  if item % 2 == 0:
    if item % 3 == 0 or item % 5 == 0:
      count += 1
  else:
    count += 1

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

Submission status: Accepted

Solution code:
N=input()
I=list(map(int,input().split()))
E=list(filter(lambda x:x%2==0,I))
if len(E)==0:
    print('APPROVED')
else:
    O=list(filter(lambda r:r%3!=0 and r%5!=0,E))
    if len(O)==0:
        print('APPROVED')
    else:
        print('DENIED')

Submission status: Accepted

Solution code:
n = int(input())

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

result = "APPROVED"
for num in nums:
    if (num % 2 == 0) and not ((num % 3 == 0) or (num % 5 == 0)):
        result = "DENIED"
        break

print(result)

Submission status: Accepted

Solution code:
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): pass
    else: print('DENIED'); exit()
print('APPROVED')

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 and a[i] % 3 != 0 and a[i] % 5 != 0:
        ok = False
if ok:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

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


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

Submission status: Accepted

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

i = 0
for document in documents:
    if document % 2 == 0:
        if not (document % 3 == 0 or document % 5 == 0):
            i = i + 1

if 1 <= i:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
t = input()
a = input().split()
a = [int(i) for i in a]
ans = "APPROVED"
for i in range(len(a)):
  if a[i] % 2 == 0:
    if a[i] % 3 == 0 or a[i] % 5 == 0:
      continue
    else:
      ans = "DENIED"
      break
  else:
    continue
print(ans)

Submission status: Accepted

Solution code:
S_list = [input() for i in range(2)]
S_list_1 = list(map(int,S_list[1].split()))

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

Submission status: Accepted

Solution code:
def main():
    _ = int(input())
    A = list(map(int,input().split()))
    for i in A:
        if i%2 == 0:
            if i%3 != 0 and i%5 != 0:
                return ("DENIED")
    return ("APPROVED")

print(main())