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

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

print("APPROVED")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N = int(input())
A = list(map(int,input().split()))

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

flag = "APPROVED"

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

print(flag)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

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

A= np.array(A)

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

if C.all():
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

    print("APPROVED")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

a = "APPROVED"
d = "DENIED"

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))
for i in a:
    #print(i)
    if i % 2 == 0:
        #print(i)
        if i % 3 != 0 and i % 5 != 0:
            print("DENIED")
            exit()
print("APPROVED")

Submission status: Accepted

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

ANS = "APPROVED"
for i in range(N):
	if 0 == A[i]%2:
		if 0 != A[i]%3:
			if 0 != A[i]%5:
				ANS = "DENIED"
print(ANS)

Submission status: Accepted

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

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

print('APPROVED')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

n = int(input())

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

ng = False
for an in a:
    if (an % 2 != 0):
        continue
    if (an % 3 == 0) | (an % 5 ==0):
        continue
    else:
        ng = True
        break
if ng:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Accepted

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


# 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():
    N = input()
    A = [int(i) for i in input().split()]
    even = list(filter(lambda x: x % 2 == 0, A))
    print('APPROVED' if len(even) == len(list(filter(lambda x: x % 3 == 0 or x % 5 == 0, even))) else 'DENIED')

    return

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


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

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

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

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

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


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

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

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

Submission status: Accepted

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

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


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

Submission status: Accepted

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

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

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

print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=list(filter(lambda x:x%2==0,a))
cnt=0
for i in b:
  if i%3==0 or i%5==0:
    cnt+=1
print('APPROVED' if cnt==len(b) else 'DENIED')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

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

l=len(rlist)
j=0

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

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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 item in a:
    if item % 2 == 0:
        if not item % 3 == 0 and not item % 5 == 0:
            print('DENIED')
            exit(0)
print('APPROVED')

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = list(map(int, input().split()))
#%%
for a in A:
    if a % 2 == 0:
        if a % 3 == 0:
            continue
        elif a % 5 == 0:
            continue

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

print('APPROVED')

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

er = 0

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

Submission status: Accepted

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

c = []

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

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8 ff=unix


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


if __name__ == "__main__":

    # N
    # A_1 A_2 \dots A_N
    #
    N = int(input())
    A = map(int, input().split())
    ans = solv(N, A)

    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input().rstrip())
As = [int(x) for x in input().rstrip().split()]
fail_flg = False
for a in As:
    if a % 2 == 1:
        continue
    elif not (a % 2 == 0 and (a % 3 == 0 or a % 5 == 0)):
        fail_flg = True
        break
if fail_flg:
    print('DENIED')
else:
    print('APPROVED')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
flag = False
count1 = 0
count2 = 0
flag = False
for i in range(N):
  if A[i]%2 == 0:
    count1 += 1
    if A[i]%3==0 or A[i]%5==0:
      count2 += 1
      
if count1 == count2:
  flag = True

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

Submission status: Accepted

Solution code:
N = int(input())
s = [int(x) for x in input().split()]
 
a = 0
for i in range(N):
    if s[i]/2 == s[i]//2:
        if s[i]/3 == s[i]//3 or s[i]/5 == s[i]//5:
          a = a + 1
    else:
        a = a + 1
 
if a == N:
    print("APPROVED")
else:
    print("DENIED")

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!python3

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

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

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A_set = list(set(A))

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

Submission status: Accepted

Solution code:


import re
import numpy as np
import math

n=input()

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

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

print(ans)

Submission status: Accepted

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

deny = 0
for even in even_list :
    if even % 3 != 0 and even % 5 != 0 :
        deny = 1
        break

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

Submission status: Accepted

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


for a in A_list:
    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()))

for v in A:
    if v % 2 != 0:
        continue
    if v % 3 != 0 and v % 5 != 0:
        print('DENIED')
        import sys
        sys.exit()

print('APPROVED')

Submission status: Accepted

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

f = True
for i in l:
    if i%2==0:
        if i%3!=0 and i%5!=0:
            f = False
            break
if f:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

for i in a:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            flag = 0
        else:
            flag = 1
            break

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

Submission status: Accepted

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

even =[]
for i in range(n):
    if a[i]%2 == 0:
        even.append(a[i])
        
ans =[]
for i in range(len(even)):
    if even[i]%3 == 0:
        ans.append(even[i])
        
for i in range(len(even)):
    if even[i]%5 == 0:
        ans.append(even[i])
        
print((set(even)==set(ans))*"APPROVED" or "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 or a[i]%5 == 0:
      continue
    else:
      print('DENIED')
      exit(0)
      
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 == 1:
    continue
  else:
    if a%3 == 0:
      continue
    elif a%5 == 0:
      continue
    else:
      ans = 'DENIED'
      break
      
print(ans)

Submission status: Accepted

Solution code:
#B
N = int(input())
A = list(map(int, input().split()))
ans = "APPROVED"

for item in A:
    if item % 2 == 0:
        if item % 3 == 0 or item % 5 == 0:
            ans = "APPROVED"
        else:
            ans = "DENIED"
            break

print(ans)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a = [int(s) for s in input().split(" ")]
    for v in a:
        if v % 2 == 0:
            if v % 3 != 0 and v % 5 != 0:
                print("DENIED")
                return
    print("APPROVED")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

B = []
C = []

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

for i in range(l):
  if B[i] % 3 == 0 or B[i] % 5 == 0:
    C.append(B[i])
    
x = len(B) - len(C)    
    
if x == 0:
  print("APPROVED")

else:
  print("DENIED")

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    n = int(input())
    an = list(map(int, input().split()))

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

    print('APPROVED')

Submission status: Accepted

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

judge = True

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


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

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

Submission status: Accepted

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

for i in range(n):
  # Aiが奇数の場合
  if (a[i] % 2 == 1):
    ans = 'APPROVED'
  # Aiが偶数の場合
  else:
    # 3でも5でも割り切れない時
    if (a[i] % 3 != 0 and a[i] % 5 != 0):
      ans = 'DENIED'
      break
    else:
      ans = 'APPROVED'

print(ans)

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

Submission status: Accepted

Solution code:
#import numpy as np
N = int(input())
A = list(map(int, input().split()))

NG = 0
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")