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:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N = int(input())
    A = map(int, input().split())

    for a in A:
        if not a % 2:
            if not a % 3 or not a % 5:
                continue
            else:
                print('DENIED')
                break
    else:
        print('APPROVED')


main()

Submission status: Accepted

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

L_even = []
for i in range(0,n):
    if L_A[i] % 2 == 0:
        L_even.append(L_A[i])

ans = 0
for i in range(0,len(L_even)):
    if L_even[i] % 3 == 0 or L_even[i] % 5 == 0:
        ans += 0
    else:
     ans += 1

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

Submission status: Accepted

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


yesno = True

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

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

Submission status: Accepted

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

def main():
    N = int(input())
    A = list(map(int, input().split()))
    flag = True

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

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

if __name__ == '__main__':
    main()

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 and A[i]%5 != 0:
            ans = "DENIED"
            break

print(ans)

Submission status: Accepted

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

for i in an:
    if i % 2 == 0:
        flag = False
        if i % 3 == 0:
            flag = True
        if i % 5 == 0:
            flag = True
        if flag == False:
            print('DENIED')
            exit()

print('APPROVED')

Submission status: Accepted

Solution code:
N = int(input())
nums = list(map(int,input().split()))
status = "APPROVED"
for num in nums:
  if num%2 == 0:
    if (num%3 == 0) or (num%5 == 0):
      continue
    else:
      status = "DENIED"
print(status)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]

result = 'APPROVED'
for i in a:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            result = 'DENIED'


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

Submission status: Accepted

Solution code:
N=map(int,input().split())
List=list(map(int,input().split()))
List_even = [i for i in List if i % 2 == 0]
count=len(List_even)
ok_counter=0
for i in range(count):
    if List_even[i] % 3 == 0:
        ok_counter+=1
        continue
    if List_even[i] % 5 == 0:
        ok_counter+=1
        continue
if ok_counter == count:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

flag = 1

for a in A:
    if a % 2 == 1:
        continue
    
    if a % 3 == 0 or a % 5 == 0:
        flag *= 1
    else:
        flag *= 0

print('APPROVED' if flag==1 else '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:
            pass
        else:
            flag = 1
            break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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



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

print("APPROVED")

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
x = 0
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            x = 1
            break

if x == 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

a = list(filter(lambda i: i%3 != 0 and i%5 != 0, filter(lambda i: i % 2 == 0, A)))
print("APPROVED" if len(a) == 0 else "DENIED")

Submission status: Accepted

Solution code:
n = int(input())
lis = list(map(int, input().split()))
flug = 0
for i in lis:
    if i % 2 == 0:
        if (i % 3 == 0) or (i % 5 == 0):
            pass
        else:
            flug = 1

if flug == 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

l = []
for i in a:
    if (i % 2 == 0):
        l.append(i)

if len(l) > 0:
    x = 0
    for i in l:
        if (i % 3 == 0) or (i % 5 == 0):
            x += 1
    if len(l) == x:
        print('APPROVED')
    else:
        print('DENIED')
else:
    print('APPROVED')

Submission status: Accepted

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

for i in range(len(b)):
  if (b[i]%6)*(b[i]%10)!=0:
    print('DENIED')
    sys.exit()
print('APPROVED')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
e = []
ans = 'APPROVED'

for i in l:
    if i % 2 == 0: e.append(i)

for i in e:
    if not i % 3 == 0 and not i % 5 == 0:
        ans = 'DENIED'
        break

print(ans)

Submission status: Accepted

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

judege=0
for num in a:
    if num%2==0:
        if num%3==0 or num%5==0:
            pass
        else:
            judege+=1

    
        
if judege==0:       
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys,collections,math,random,fractions,bisect;sys.setrecursionlimit(10**7)
sr = sys.stdin.readline; P = print; P2 = lambda x: print(*x, sep="\n")
def I(i=0): t = [int(x)-i for x in sr().split()];return t
def S(): t = sr().split(); return t if len(t) > 1 else t[0]
L1,L2,L3,L4, = [],[],[],[]
 
N = I()
a = I()
ans = "APPROVED"
for e in a:
    if e%2 == 0:
        if e/3 != e//3 and e/5 != e//5:
            ans = "DENIED"
            break
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 or i % 5 == 0:
            pass
        else:
            print('DENIED')
            exit()
else:
    print('APPROVED')

Submission status: Accepted

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

flag = True
for i in l:
    if i % 2 == 0:
        if not (i % 3 == 0 or i % 5 == 0):
            flag = False
            break

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

Submission status: Accepted

Solution code:
n = input()
_list = input().split(" ")
_list = [int(x) for x in _list]
even = [x for x in _list if x % 2==0]
answer = []
for x in even:
    if x % 3 == 0 or x % 5 == 0:
        answer.append(True)
if len(even) ==len(answer):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in A:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 ==0:
            judge.append("APPROVED")
        else:
            judge.append("DENIED")
    else:
        pass

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
    if a_list[i] % 2 == 0:
        # 偶数
        if a_list[i] % 3 != 0 and a_list[i] % 5 != 0:
            f_denied = f_denied + 1

if f_denied != 0:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
 
t = sys.stdin.read()
a = map(int, t.split("\n")[1].split())
 
def check(a):
    for b in a:
        if b % 2 == 0:
            if b % 3 == 0 or b % 5 == 0:
                pass
            else:
                return False
    return True
 
if check(a):
    print "APPROVED"
else:
    print "DENIED"

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def main():
  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:
        pass
      else:
        ans = 'DENIED'
    else:
      pass
  print(ans)
if __name__ == '__main__':
  main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(judge)

Submission status: Accepted

Solution code:
import sys
N = input()
num =  [int(num) for num in input().split()]
flag=0
for n in num:
    if n % 2 == 0:
        if n % 3 == 0 or n % 5 == 0:
            flag = 0
        else:
            print('DENIED')
            sys.exit()
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"
    break
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
##B
N = int(input())
A = list(map(int,input().split()))
ans = 0
ans1 = 0
for i in A:
    if i % 2 == 0:
        ans += 1
        if i % 3 == 0 or i % 5 ==0:
            ans1 += 1
if ans == ans1:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

Solution code:
n = int(input())
arr = filter(lambda x: x % 2 == 0, list(map(int, input().split())))
for a in arr:
  if a % 3 == 0 or a % 5 == 0:
    continue
  else:
    print("DENIED")
    exit()
print("APPROVED")

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def is_approved(num):

    if num % 2 == 1:
        return True
    elif num % 3 == 0 or num % 5 == 0:
        return True
    
    return False

def main():

    n = int(input())
    an = list(map(int,input().split()[:n]))

    for num in an:
        if not is_approved(num):
            print('DENIED')
            exit()
    print('APPROVED')

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    a = [i for i in A if i%2==0]
    for j in a:
        if j%3!=0 and j%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()))
x = True
for i in range(len(a)):
  if a[i]%2==1:
    continue
  else:
    if (a[i]%3!=0)&(a[i]%5!=0):
      x = False
if x == False:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Accepted

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

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

Submission status: Accepted

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

check = 0
for num in nums:
    if num % 2 == 0:
        if num % 3 == 0 or num % 5 == 0:
            continue
        else:
            check += 1
            
if check == 0:
    print("APPROVED")
else:
    print("DENIED")

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:
                ans = 'DENIED'

    return ans

print(solve())

Submission status: Accepted

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

res = "APPROVED"

for i in A_lst:
    if i % 2 == 0:
        if i%3!=0 and i%5!=0:
            res = "DENIED"
            break
        
print(res)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
even=[]
for a in A:
    if a%2==0:
        even.append(a)
    
if len(even)==0:
    print("APPROVED")
    exit()
    
ans=False
    
for e in even:
    if e%3==0 or e%5==0:
        ans=True
    else:
        ans=False
        break

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

Submission status: Accepted

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

for val in A:
  if val % 2 == 0:
    if val % 3 != 0 and val % 5 != 0:
      flag = 1 
    
if flag == 0:
  print("APPROVED")
elif flag == 1:
  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 or a[i]%5 == 0:
            continue
        else:
            flag = False

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(int(x) for x in input().split())

tmp = []
for _a in a:
  if _a % 2 == 0:
    tmp.append(_a)

tmp2 = []
for t in tmp:
  if t % 3 == 0 or t % 5 == 0:
    tmp2.append(True)
  else:
    tmp2.append(False)

if False in tmp2:
  print('DENIED')
else:
  print('APPROVED')

Submission status: Accepted

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: Accepted

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
flg = False
for a in a_list:
  if a % 2 == 0:
    if a % 3 > 0 and a % 5 > 0:
      flg = True
      break
  else:
    continue
if flg:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Accepted

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    n = int(lines[0])
    a = [int(e) for e in lines[1].split(" ")]

    return (n, a)


def solve(n, a):

    even = [e for e in a if e % 2 == 0]    

    result = 'APPROVED'
    for i in range(len(even)):
        e = even[i]
        if e % 3 == 0:
            pass 
        elif e % 5 == 0:
            pass
        else:
            result = 'DENIED'
            break


    return result
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

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

flg = 0

for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            flg = 1

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

Submission status: Accepted

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

flag = True

for num in numbers:
    if num % 2 == 0:
        if num % 3 != 0 and num % 5 != 0:
            flag = False
            break
            
if flag:
    print('APPROVED')
else :
    print('DENIED')

Submission status: Accepted

Solution code:
def calc(nums):
    for n in nums:
        if n % 2 == 0:
            if not (n % 3 == 0 or n % 5 == 0):
                return False
    return True

if __name__ == '__main__':
    N = int(input())
    nums = list(map(int, input().split()))
    if calc(nums):
        print('APPROVED')
    else:
        print('DENIED')

Submission status: Accepted

Solution code:
import sys

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

if input_line == []:
  print("APPROVED")
  sys.exit()

for i in input_line:
  if i % 3 == 0:
    continue
  if i % 5 == 0:
    continue
  print("DENIED")
  sys.exit()
print("APPROVED")

Submission status: Accepted

Solution code:
n = int(input())
an = input().split(' ')

ans = "APPROVED"
for i in range(n):
    a = int(an[i])
    if (a%2 == 0 and a%3 != 0 and a%5 !=0):
            ans = "DENIED"

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
k = 0
for i in a:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            pass
        else:
            k += 1
    else:
        pass

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

Submission status: Accepted

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

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

Submission status: Accepted

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

evens = list()
for number in numbers:
    if(number%2 == 0):
        evens.append(number)

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

if(illegal == 0):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
list=list(input().split())
result=1
for i in range(a):
  if int(list[i])%2 == 0:
    if int(list[i])%3 !=0 and int(list[i])%5 !=0:
      print('DENIED')
      result=0
      break
if result != 0:
	print('APPROVED')

Submission status: Accepted

Solution code:
N = int(input())
ALis = list(map(int,input().split()))
Flag = True

for i in range(N):
    if ALis[i] % 2 == 0:
        if ALis[i] % 3 != 0 and ALis[i] % 5 != 0:
           Flag = False

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

Submission status: Accepted

Solution code:
def shinsa(data):
    for i in data:
        if i % 2 == 0:
            if i % 3 == 0 or i % 5 == 0:
                continue
            else:
                return 'DENIED'

    return 'APPROVED'

a = int(input())
data = [int(x) for x in input().split()]

result = shinsa(data)
print(result)

Submission status: Accepted

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

for i in range(n):
    if a[i]%2 == 0:
        if a[i]%3 != 0 and a[i]%5 != 0:
            k += 1
        else:
            continue
    else:
        continue

if k == 0:
    print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

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

flag = 1

for i in lst:
  if i%2 == 0 and i%3 != 0 and i%5 != 0:
    flag = 0
    
if flag == 1:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Accepted

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

for a in As:
    if a%2 == 0:
        if a%3 == 0 or a%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()))

count = 0

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

Submission status: Accepted

Solution code:
n = int(input())
listA = list(map(int,input().split()))
res = []
for i in listA:
    if i % 2 == 0:
        if i % 3 ==0 or i % 5==0:
            res.append('OK')
        else:
            res.append('NO')
    else:
        res.append('OK')
if 'NO' in res:
    print('DENIED')
else:
    print('APPROVED')

Submission status: Accepted

Solution code:

n = int(input())
a = list(map(int,input().split()))
b = []
status = 0

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

for j in range(len(b)):
    if b[j] % 3 == 0 or b[j] % 5 == 0:
        pass
    else:
        status = 1

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

Submission status: Accepted

Solution code:
import sys

n = input()
data = input()
nums = data.split(' ')

flag = 0
for number in nums:
    num = int(number)
    if num % 2 == 0:
        if not(num % 3 == 0 or num % 5 == 0):
            print('DENIED')
            flag = 1
            break
if flag == 0:
    print('APPROVED')

Submission status: Accepted

Solution code:
cou = int(input())
a = list(map(int,input().split()))
ans = 0

for i in range(cou):
    b = a[i]
    if b % 2 == 0:
        if b % 3 == 0:
            ans += 1
        elif b %5 == 0:
            ans += 1
        else:
            break
    else:
        ans += 1

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

Submission status: Accepted

Solution code:
count = int(input())
numbers = input().split(' ')
check = 0

for number in numbers:
    int_number = int(number)
    if int_number % 2 == 0:
        if int_number % 3 == 0:
            continue
        if int_number % 5 == 0:
            continue
        else:
            check = 1
            break




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

Submission status: Accepted

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

def valid(x):
    if x % 2 == 0:
        return (x % 3 == 0) or (x % 5 == 0)
    else:
        return True

if all(map(valid, nums)):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
A_odd = list(filter(lambda x: x%2==0, A))

if (len(list(filter(lambda x: (x%3==0)or(x%5==0) ,A_odd))) == len(A_odd)):
    print('APPROVED')
else:
    print('DENIED')

Submission status: Accepted

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


hanntei = 0 

for i in range(N):
    ch1 = A[i] % 2
    ch2 = A[i] % 3
    ch3 = A[i] % 5
    if ch1 == 0 and ch2 != 0 and ch3 != 0:
        hanntei = 1
        break

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

Submission status: Accepted

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

print('APPROVED')

Submission status: Accepted

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

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

Submission status: Accepted

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

flag=True

for i in A:
    if i%2==0:
        
        if i%3==0 or i%5==0:
            count=0
        else:
            flag=False

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

Submission status: Accepted

Solution code:
n=input()
inp = [int(ele) for ele in input().split() if int(ele)%2==0]
t=0
for ele in inp:
    if ele%3==0 or ele%5==0:
        t+=1
print("APPROVED" if t==len(inp) else "DENIED")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    admit = True
    for n in range(N):
        if A[n] % 2 == 0 and not (A[n] % 3 == 0 or A[n] % 5 == 0):
            admit = False
    if admit:
        print('APPROVED')
    else:
        print('DENIED')
    
main()

Submission status: Accepted

Solution code:

cnt  = int(input())
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: Accepted

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

for i in range(N):
  if A[i]%2==0 and A[i]%3!=0 and A[i]%5!=0:
    s+=1
if s==0:
  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 and A[i]%5 != 0:
      ans = "DENIED"

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

s = input().split()


flag = 0

for i in s:
    if(int(i)%2 == 0):
        if(int(i)%3 != 0 and int(i)%5 != 0):
            flag = 1


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

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
gus=[]
for i in L:
    if i%2==0:
        gus.append(i)

ans=True
for i in gus:
    if not i%3==0:
        if not i%5==0:
            print("DENIED")
            ans=False
            break

if ans:
    print("APPROVED")