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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

j = True
for _ in range(N):
    if A[_] % 2 == 0:
        if A[_] %3 == 0 or A[_] % 5 ==0:
            pass
        else:
            j = False
            exit()
            
if j:
    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 == 1:
        continue
    if i % 3 == 0 or i % 5 == 0:
        continue
    print("DENIED")
print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = int(input())
A=list(map(int,input().split()))
B=[i for i in A if i%2==0]
x=0
for j in B :
    if (j%3==0) or (j%5)==0:
        x +=1
    else:
        print("DINIED")
        break
if x==len(B):
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
l2 = [i for i in l if i % 2 == 0]
l3 = [i for i in l2 if i % 3 == 0]
l4 = [i for i in l2 if i % 5 == 0]
l5 = list(set(l4+l3))
if len(l5) != len(l2):
    print('DENIED')
else:
    print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
l2 = [i for i in l if i % 2 == 0]
l3 = [i for i in l2 if i % 3 == 0]
l4 = [i for i in l2 if i % 5 == 0]
l5 = list(set(l4+l3))
if len(l) == n:
    if len(l5) == len(l2):
        print('APPROVED')
    else:
        print('DENIED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
l2 = [i for i in l if i % 2 == 0]
l3 = [i for i in l2 if i % 3 == 0]
l4 = [i for i in l2 if i % 5 == 0]
l5 = list(set(l4+l3))
if len(l5) == len(l2):
    if len(l2) != 0:
        print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
l2 = [i for i in l if i % 2 == 0]
l3 = [i for i in l2 if i % 3 == 0]
l4 = [i for i in l2 if i % 5 == 0]
l5 = list(set(l4+l3))
if len(l5) == len(l2):
        print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
l2 = [i for i in l if i % 2 == 0]
l3 = [i for i in l2 if i % 3 == 0]
l4 = [i for i in l2 if i % 5 == 0]
l5 = list(set(l4+l3))
if len(l5) != len(l2):
    if len(l2) != 0:
        print('DENIED')
    else:
        print('APPROVED')
else:
    print('APPROVED')

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
l2 = [i for i in l if i % 2 == 0]
l3 = [i for i in l2 if i % 3 == 0]
l4 = [i for i in l2 if i % 5 == 0]
l5 = list(set(l4+l3))
if len(l2) == 0:
    print('APPROVED')
    exit()
elif len(l5) != len(l2):
    print('DENIED')
else:
    print('APPROVED')
print(l5)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
stdin = open(0).read().split('\n')
N=int(stdin[0])
A=map(int,stdin[1].split())
flag=True
for a in A:
    if a%2==0 and a%3!=0 and a%5!=0:
        flag=False
        exit()
print('APPROVED' if flag else 'DENIED')

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
arr = list(map(int, input().split()))

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

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
arr = list(map(int, input().split()))

for i in range(len(arr)):
    if arr[i] % 2 == 0 and (arr[i] % 3 != 0 and arr[i] % 5 != 0):
        print("DENIED")
        break
    else:
        print("APPRPVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in An:
    if i%2==0:
        if i%3 !=0 and i%5==0:
            print('DENIED')
            exit()
else:
    print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

N = X[0]
X = X[1:]

Y = [x for x in X if x%2 == 0]

Z = [y for y in Y if y%3 != 0 and y%5 != 0]

if len(Z) == 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

N = X[0]
X = X[1:]

Y = [x for x in X if x%2 == 0]

Z = [y for y in Y if y%3 != 0 and y%5 != 0]

print(Z)

if len(Z) == 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
list = [int(i) for i in input().split()]
N = list[0]
A = list[1:N+1]
if all([i%2==1 for i in A]):
    print('DENIED')
else:
    even = [i for i in A if i%2==0]
    even = [0 if i%3==0 or i%5==0 else 1 for i in even]
    if max(even)==1:
        print('DENIED')
    else:
        print('APPROVED')

Submission status: Wrong Answer

Solution code:
list = [int(i) for i in input().split()]
N = list[0]
A = list[1:N+1]
if all([i%2==1 for i in A]):
    print('APPROVED')
else:
    even = [i for i in A if i%2==0]
    even = [0 if i%3==0 or i%5==0 else 1 for i in even]
    if max(even)==1:
        print('DENIED')
    else:
        print('APPROVED')

Submission status: Wrong Answer

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

N = X[0]
X = X[1:]

Y = [x for x in X if x%2 == 0]

Y1 = [x for x in Y if x%3 == 0]
Y2 = [x for x in Y if x%5 == 0]

if set(Y) == set(Y1)|set(Y2):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
list = [int(i) for i in input().split()]
N = list[0]
A = list[1:N+1]
if all([i%2==1 for i in A]):
    print('APPROVED')
else:
    even = [i for i in A if i%2==0]
    even = [0 if i%3==0 or i%5==0 else i for i in even]
    if max(even)>0:
        print('DENIED')
    else:
        print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())

a = [0]*N
a = list(map(int, input().split()))
for i in range(N):
  
  if a[i]%2 == 0:
    if a[i]%3 != 0 and a[i]%5 != 0:
      print('DENIED')
      break
  if i == N-1:
    print('APPROVE')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print("APPROVED")

Submission status: Wrong Answer

Solution code:
N=int(input())
K=list(map(int,input().split()))
def a(K):
    for i in range(len(K)):
        if (K[i]%2==0 and K[i]%3==0) or (K[i]%2==0 and K[i]%5==0):
            return print("APPROVED")
    return print("DENIED")

a(K)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=list(map(int,input().split()))
def a(K):
    for i in range(len(K)):
        if (K[i]%2==0 and K[i]%3==0) or (K[i]%2==0 and K[i]%5==0):
            return print("Yes")
    return print("No")

a(K)

Submission status: Wrong Answer

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

for i in lists:
    if i % 2 == 0:
        if i % 3 == 0:
            break

        elif i % 5 == 0:
            break

        else:
            print("DENIED")
            exit()

print("APPROVED")

Submission status: Wrong Answer

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

a = []
for i in lists:
    if i % 2 == 0:
        a.append(i)
        count = 0
        if i % 3 == 0:
            break

        elif i % 5 == 0:
            break

        else:
            print("DENIED")
            exit()

print("APPROVED")

Submission status: Wrong Answer

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

if {0} == set([(Ai%3)*(Ai%5) for Ai in A if Ai%2 == 0]):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

Aeven = [Ai for Ai in A if Ai%2 == 0]

if {0} == set([(Ai%3)*(Ai%5) for Ai in Aeven]):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
array = [int(x) for x in input().split()]
fg=False
for i in array:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      fg = True
    else:
      fg = False
      print('DENIED')
      break
if fg:
  print('APPROVED')

Submission status: Wrong Answer

Solution code:
# -*- codong:utf-8 -*-
N=int(input())
A=list(map(int,input().split()))
ans1=0
ans2=0
for i in range(N):
    if A[i]%2==0:
        ans1=1
        if A[i]%3==0 or A[i]%5==0:
            ans2=1
if ans1==0 or ans2==1:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
# -*- codong:utf-8 -*-
N=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(N):
    if A[i]%2==0:
        if A[i]%3==0 or A[i]%5==0:
            ans=1
if ans==1:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
_=input()
a=list(map(int,input().split()))
on=True
for i in a:
  if i%2==0 and i % 3 != 0 and i % 5 != 0:
			on=False
			exit()
print("APPROVED" if on else "DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
flag = "ok"
for i in a_list:
  if i%2 == 0: 
    if i%3 != 0 or i%5 != 0:
      flag = "ng"
if flag == "ok":
  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 or a[i]%5!=0:
      print("DENIED")
      exit()
print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
list = []
a = input().split()
for i in range(0, len(a)):
    list.append(int(a[i]))
for item in list:
    if item%2==0:
        if item%3==0 or item%5==0:
            a = 1
        else:
            print('DENIED')
            a = 0
        break
if a == 1:
    print('APPROVED')
else:
    b = 2

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0]*N
check = 1
A =  [int(N) for N in input().split()]
for i in range (N):
    if (A[i]%2)==0:
        if (A[i]%3)==0:
            check += 1
        elif (A[i]%5)==0:
            check += 1
        else:
            check = 0
if check >1:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
t1 = []
t2 = []
for i in a:
    if i % 2 == 0:
        t1.append(i)
        if i % 3 == 0 or i % 5 == 0:
            t2.append(i)
if len(t1) > 0 and t1 == t2:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
p = int(input())

vals = input().split(" ")
vals = map(int, vals)

bol = True

for val in vals :
	if val % 2 == 0 :
	  if not (val % p == 0 ) :
	    bol = False

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

Submission status: Wrong Answer

Solution code:

vals = input().split(" ")
vals = map(int, vals)

bol = True

for val in vals :
	if val % 2 == 0 :
	  if not (val % 3 == 0 or val % 5 == 0) :
	    bol = False

if bol :
  print("APPLOVE")
else : 
  print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for a in aa:
    if n % 2 == 0 and not (n % 3 == 0 or n % 5 == 0):
        print("DENIED")
        exit(0)
print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = int(input())

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

flag = False

for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            flag = True
    else:
        pass
if flag == True:
    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 ==0 or i %5 ==0:
        print("APPROVED")
      else:
        print("DENIED")
        break
else:
  print("APPROVED")

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(s) for s in 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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
c=list(map(int,input().split()))
flag=0
for i in range(N):

    if c[i]%2==0:
        if c[i]%3==0 or c[i]%5==0:
            flag=1
        else:
            print("DENIED")
            exit(0)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

A_ = [a for a in A if a % 2 == 0 and a % 3 == 0 and a % 5 == 0]

if len(A_) == N:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

def f(x):
   if x % 2 == 0:
       if x % 3 == 0 | x % 5 == 0:
           return True
       else:
           return False
   else:
       return True
A_ = map(f, A)


if False in A_:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

Solution code:
x = int(input())

n = []
# for i in range(x):
#     n[i] = int(input())
n = [int(e) for e in input().split()]

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

cal(n)

Submission status: Wrong Answer

Solution code:

x = int(input())

n = []
# for i in range(x):
#     n[i] = int(input())
n = [int(e) for e in input().split()]

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

cal(n)

Submission status: Wrong Answer

Solution code:
x = int(input())

n = []
# for i in range(x):
#     n[i] = int(input())
n = [int(e) for e in input().split()]

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

cal(n)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    i = 0
    while i < N:
        if A[i] % 2 == 0:
            if (A[i] % 3) != 0 and (A[i] % 5) != 0:
                break
                return("DENIED")
        i += 1
    return("APPROVED")
print(main())

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    i = 0
    while i < N:
        if A[i] % 2 == 0:
            if (A[i] % 3) != 0 and (A[i] % 5) != 0:
                break
        i += 1
    return("APPROVED")
print(main())

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    i = 0
    s = ""
    while i < N:
        if A[i] % 2 == 0:
            if (A[i] % 3) == 0 or (A[i] % 5) == 0:
                continue
            else:
                print("DENIED")
        i += 1
    print("APPROVED")
main()

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    i = 0
    s = ""
    while i < N:
        if A[i] % 2 == 0:
            if (A[i] % 3) == 0 or (A[i] % 5) == 0:
                s += "a"
            else:
                s += "d"
        i += 1
    if s in "d":
        print("APPROVED")
    else:
        print("DENIED")
main()

Submission status: Wrong Answer

Solution code:
N = int(input())
lst = input().split(' ')
good = False
for v in lst:
  if int(v) % 2 != 0:
    continue
  elif int(v) % 3 != 0 and int(v) % 5 != 0:
    print('DENIED')
    break
  else:
    good = True
if good:
  print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())
lst = input().split(' ')
good = False
for v in lst:
  if int(v) % 2 != 0:
    continue
  elif int(v) % 3 != 0 and int(v) % 5 != 0:
    print('DENIED')
    break
  else:
    good = True
if good:
  print('APPROVE')

Submission status: Wrong Answer

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

check = 0
for i in range(n) :
  if a[i]%2 == 0 :
    if a[i]%3 == 0 or a[i]%5 == 0 :
      continue
    else :
      check = 1

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

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

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

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] != 0 or a[i] != 0:
            print('DENIED')
            break

else:
    print('APROVED')

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] != 0 or a[i] != 0:
            print('DENIED')
            break

else:
    print('APPROVED')

Submission status: Wrong Answer

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

ans = False
for a in n:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            ans = True
if ans:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

L = []
for i in range(N):
    if n[i] % 2 == 0:
        if n[i] % 3 == 0 or n[i] % 5 == 0:
            L.append(1)
    else:
        L.append(0)

if 1 in L:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

L = []
for i in range(N):
    if n[i] % 2 == 0 and n[i] % 3 == 0 or n[i] % 5 == 0:
        L.append(1)
    else:
        L.append(0)

if 1 in L:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
n = int(input())
data = input().split()
 
ans = "APPROVED"
 
for i in range(n):
  num = int(data[i])
  if not(num % 6 == 0 or num % 10 == 0):
    ans = "DENIED"
    break
 
print(ans)

Submission status: Wrong Answer

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

for i in range(N):
    if n[i] % 2 == 0:
        if n[i] % 3 == 0 or n[i] % 5 == 0:
            print("APPROVED")
            break
        else:
            print("DENIED")
            break

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
def linersearch(N,A):
    for i in range(N):
        if A[i]%3==0 or A[i]%5==0:
            return "APPROVED"
        else:
            return "DENIED"
linersearch(N,A)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
def linersearch(N,A):
    for i in range(N):
        if A[i]%3==0 or A[i]%5==0:
            return "APPROVED"
    return "DENIED"
linersearch(N,A)

Submission status: Wrong Answer

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

if len(B)==0:
    res='DENIED'
if 0<len(B):
    for b in B:
        if (b%3!=0)&(b%5!=0):
            res='DENIED'
print(res)

Submission status: Wrong Answer

Solution code:
x=int(input())
y=input()
z=y.split()
e=0
for i in z:
    w=int(i)%2
    if w%2 == 0:
        if w%5 == 0:
            continue
        elif w%3 ==0:
            continue
        else:
            e=1
        
if e == 1:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

ans="DENIED"
if 1<=n<=100 and 1<=min(a) and max(a)<=1000:
    for i in range(n-1):
        if a[i]%6==0 or a[i]%10==0:
            pass
        elif a[i]%2==1:
            pass
        else:
            break
    else:
        ans="APPROVED"

print(ans)

Submission status: Wrong Answer

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

ans="DENIED"
if 1<=n<=100 and 1<=min(a) and max(a)<=1000:
    for i in range(n-1):
        if a[i]%2==0 and (a[i]%3==0 or a[i]%5==0):
            pass
        elif a[i]%2==1:
            pass
        else:
            break
    else:
        ans="APPROVED"

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
p = input()
b = map(int,raw_input().split())
# a = sum(map(int,raw_input().split()))
r = "APPROVED"
for i in b:
    if i%3!=0 and i%5!=0:
        r = "DENIED"
        break
print r