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()))
count = True
for i in range(n-1):
    if a[i]%2 == 0:
        if(a[i]%3 != 0 and a[i]%5 != 0):
            count = False
            break
if count:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
input()
o = True
for i in map(int, input().split()):
  if i % 2 == 0:
  	if i % 3 == 1 and i % 5 == 1:
  		o = False

if o is True:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

main()

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 and i%5!=0:
            print('DENINED')
            break
else:
    print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
if any(i%2==0 and i%3!=0 and i%5!=0 for i in A):
    print('DENINED')
else:
    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())
a = [int(i) for i in input().split()]
flag = True
for i in a:
    if i%3 != 0 and i%5 != 0:
        flag = False

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

Submission status: Wrong Answer

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

i = 0
a = 0
b = 0
y = 0

for i in range(N):
  if X[i] % 2 == 0:  
    a = a + 1
    if X[i] % 3 == 0 or X[i] % 5 == 0:
      y = y + 1
    else:
      print("DENIED")
      break
  else:
    b = b + 1

if b == 0 and N == y:
  print("APPROVED")

Submission status: Wrong Answer

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

i = 0
a = 0
b = 0
y = 0

for i in range(N):
  if X[i] % 2 == 0:  
    a = a + 1
    if X[i] % 3 == 0 or X[i] % 5 == 0:
      y = y + 1
    else:
      break
  else:
    b = b + 1

if b == 0 and N == y:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
n = int(input())

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

lst = []

flg = False

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

for i in range(len(lst)):
    if lst[i] % 2 == 0 and lst[i] % 3 == 0 or lst[i] % 5 == 0:
        flg = True
    else:
        flg = False
        break

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

lst = []

flg = False

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

for i in range(len(lst)):
    if lst[i] % 3 == 0 or lst[i] % 5 == 0:
        flg = True
    else:
        flg = False
        break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
n = 5
a = np.array([6, 7, 9, 10, 31])

for i in range(n):
    if a[i]%3 != 0 and a[i]%5 != 0:
        print("APPROVED")
        sys.exit()

print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in a:
  if i % 6 == 0 or i % 10 == 0:
    flag = 1
  else:
    flag = 0
    
if flag == 1:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Wrong Answer

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:
      flag = 1
      pass
    elif i % 5 == 0:
      flag = 1
      pass
    else:
      print('DENIED')
      flag = 0
      break
  else:
    flag = 0
    
if flag == 1:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Wrong Answer

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:
      flag = 1
      pass
    elif i % 5 == 0:
      flag = 1
      pass
    else:
      print('DENIED')
      flag = 0
      break
  else:
    print('DENIED')
    
if flag == 1:
  print('APPROVED')

Submission status: Wrong Answer

Solution code:
_,a=open(0);print('ADPEPNRIOEVDE D'[any(a%3*a%5&~a for a in map(int,a.split()))::2])

Submission status: Wrong Answer

Solution code:
_,a=open(0);print('ADPEPNRIOEVDE D'[any(~a&a%3*a%5for a in map(int,a.split()))::2])

Submission status: Wrong Answer

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:
      flag = 1
      pass
    elif i % 5 == 0:
      flag = 1
      pass
    else:
      print('DENIED')
      flag = 0
      break
  
if flag == 1:
  print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    _ = int(input())
    a = list(map(int, input().split()))
    odds = []
    for i in a:
        if i % 2 == 0:
            odds.append(i)

    for i in odds:
        if i % 3 != 0 and i % 5 != 0:
            print("DENIED")
            return

    print("APPROVED")


def main1():
    _ = int(input())
    a = list(map(int, input().split()))
    odds = filter(lambda x: x % 2 == 0, a)
    denied = filter(lambda x: x % 3 != 0 and x % 5 != 0, odds)
    if denied:
        print("DENIED")
    else:
        print("APPROVED")
        

if __name__ == "__main__":
    main1()

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int, input().strip().split()))
count = int(0)
flag = int(0)
for x in range(N):
    if array[x] % 2 == 0:
        count += 1
        if array[x] % 3 == 0 or array[x] % 5 == 0:
            print('APPROVED')
            flag = 1
            break
        else:
            print('DENIED')
            flag = 1
            break
if count == 0:
        print('APPROVED')
        flag = 1
if flag == 0:
    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 and i%2!=0 and i%5==0:
        print('DENIED')
        exit()
print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
print('APPROVED' if all([a % 6 == 0 or a % 10 == 0 for a in A]) else 'DENIED')

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split(' ')))
for i in A:
    if i%2==0 and i%2!=0 and i%5==0:
        print('DENIED')
        exit()
print('APPROVE')

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
A = [int(i) for i in input().split()]
 
flag = True
for a in A:
  if a%2 == 0:
    if a%3 != 0 or a%5 != 0:
      flag = False

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

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int, input().strip().split()))
count = int(0)
flag = int(0)
for x in range(N):
    if array[x] % 2 == 0:
        count += 1
        if array[x] % 3 == 0 or array[x] % 5 == 0:
            print('APPROVED')
            flag = 1
            break
        else:
            print('DENIED')
            flag = 1
            break
if flag == 0:
    if count == 0:
        print('APPROVED')
        flag = 1
if flag == 0:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int, input().strip().split()))
count = int(0)
flag = int(0)
for x in range(N):
    if array[x] % 2 == 0:
        count += 1
        if array[x] % 3 == 0 or array[x] % 5 == 0:
            print('APPROVED')
            flag = 1
            break
        else:
            print('DENIED')
            flag = 1
            break
if flag == 0:
    if count == N:
        print('APPROVED')
        flag = 1
if flag == 0:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
*A, = map(int, input().split())
print(A)
B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0
for l in B:
  if l % 5 == 1 or l % 3 == 0:
    C = C + 1
 
if len(B) == 0:
  print('APPROVED')
elif C/len(B) == 1:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()
b = input().split()
c = "APPROVED"
for i in b:
    if int(i)%6 != 0 or int(i)%10 != 0:
        c = "DENIED"
        break

print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int, input().strip().split()))
count = int(0)
flag = int(0)
for x in range(N):
    if array[x] % 2 == 0:
        count += 1
        if array[x] % 3 == 0 or array[x] % 5 == 0:
            print('APPROVED')
            flag = 1
            break
if flag == 0:
    if count == N:
        print('APPROVED')
        flag = 1
if flag == 0:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int, input().strip().split()))
count = int(0)
flag = int(0)
for x in range(N):
    if array[x] % 2 == 0:
        count += 1
        if array[x] % 3 == 0 or array[x] % 5 == 0:
            print('APPROVED')
            flag = 1
            break
if flag == 0:
    if count == N - 1:
        print('APPROVED')
        flag = 1
if flag == 0:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int, input().strip().split()))
count = int(0)
flag = int(0)
for x in range(N):
    if array[x] % 2 == 0:
        count += 1
        if array[x] % 3 == 0 or array[x] % 5 == 0:
            print('APPROVED')
            flag = 1
            break
if flag == 1:
    if count == N - 1:
        print('APPROVED')
        flag = 2
if flag == 0:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
_,a=open(0);print(any(a%3*a%5*~a%2for a in map(int,a.split()))and'DENIED'or'APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int, input().strip().split()))
count = int(0)
flag = int(0)
for x in range(N):
    if array[x] % 2 == 0:
        count += 1
        if array[x] % 3 == 0 or array[x] % 5 == 0:
            print('APPROVED')
            flag = 1
            break
if flag == 1:
    if count == N:
        print('APPROVED')
        flag = 2
if flag == 0:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
_,a=open(0);print('ADPEPNRIOEVDE D'[any(a%3*a%5*~a%2for a in map(int,a.split()))::2])

Submission status: Wrong Answer

Solution code:
N = int(input())
array = list(map(int, input().strip().split()))
count = int(0)
flag = int(0)
for x in range(N):
    if array[x] % 2 == 0:
        count += 1
        if array[x] % 3 == 0 or array[x] % 5 == 0:
            print('APPROVED')
            flag = 1
            break
if count == N:
    print('APPROVED')
    flag = 1
if flag == 0:
    print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def validate(i):
    I=i%2
    if I==0:
        I1=i%3
        I2=i%5
        if I1==0 or I2==0:
            return "Yes"
        else:
            return "No"
    else:
        return "Yes"

for i in A:
    X=validate(int(i))

if "No" in X:
    print("DENIED") 
else:
     print("APPROVED")

Submission status: Wrong Answer

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

# 偶数を入れる配列
a = []
# 3または5で割れる数字を入れる配列
b = []

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

    # print(a)
    
    for li in a:
        if li % 3 == 0:
            a.remove(li)
        elif li % 5 == 0:
            a.remove(li)
    
if a == []:
    print("APPROVED")
else:
    print("DINIED")

Submission status: Wrong Answer

Solution code:
a = input()
b = input().split()
c = "APPROVED"
for i in b:
    if int(i)%6 != 0 and int(i)%10 != 0:
        c = "DENIED"
        break

print(c)

Submission status: Wrong Answer

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

i = 0
a = 0
y = 0
b = 0

for i in range(N):
  if X[i] // 2 == 0:  
    a = a + 1
    if X[i] // 3 == 0 or X[i] // 5 == 0:
      y = y + 1
    else:
      break
  else:
    b = b + 1

if b == 0 and N == y:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

C = True
count = 0

def check(i):
    if i % 5 == 0 or i % 3 == 0:
        return True
    else:
        return False   
if len(A) <= N:       
    for i in A :
        if i % 2 == 0:
            validation =  check(i)
            if validation == False:
                C = False
                break
        else:
            C = False
else:
    C = False

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int , input().split()))
B = []
acount = 0
bcount = 0
for i in A:
    if i % 2 == 1:
         pass
    else:
        acount += 1
        B.append(i)
if len(B) > 0:
    for i in B:
        if i % 3 == 0 or i % 5 == 0:
             bcount += 1
if N == 0:
    print('DENIED')
elif N != len(A):
    print('DENIED')
elif N > 100:
    print('DENIED')
elif len(A) > 1000:
    print('DENIED')
elif acount == 0:
    print('DENIED')
elif bcount == 0:
    print('DENIED')
elif acount == bcount:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
a = input()
b = input().split()
c = "approved"
for i in b:
    if int(i)%6 != 0 and int(i)%10 != 0:
        c = "denied"
        break
print(c)

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    A = list(map(int,input().split()))
    a = []
    Q = 0
    L = 0
    for g in range(N):
        d = A[g]
        D = d % 2
        if D == 0 :
            a.append(d)
    _a = len(a)
    for X in range(_a) :
        x = a[X]
        K = x % 3
        s = x % 5
        if K == 0 or s == 0 :
            Q += 1
        else :
            L += 1
    if L == 0 :
        if Q >= 1:
            print('APPROVED')
    else:
        print('DENIED')
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int , input().split()))
B = []
acount = 0
bcount = 0
for i in A:
    if i % 2 == 1:
         pass
    else:
        acount += 1
        B.append(i)
if len(B) > 0:
    for i in B:
        if i % 3 == 0 or i % 5 == 0:
             bcount += 1
if N == 0:
    print('DENIED')
elif N != len(A):
    print('DENIED')
elif acount == 0:
    print('DENIED')
elif bcount == 0:
    print('DENIED')
elif acount == bcount:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
num = int(input())
if num == 1:
  immigration_num = [int(input())]
else:
  input_line = input().split(' ')
  immigration_num = [int(i) for i in input_line]

immigration = True;
count = 0
for i in immigration_num:
  if(i % 2 == 0) :
    count = count + 1
    if(i % 3 != 0 and i % 5 != 0):
      immigration = False;
      
if(immigration and count > 0):
  print('APPROVED')
else:
  print('DENIED')

Submission status: Wrong Answer

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

# Input
s = [input() for i in range(2)]
N = int(s[0])
As = sorted(list(s[1].split()))

# Proccess
pp = "APPROVED"

for i in range(0,N-1):
	if int(As[i]) % 2 == 0 :
		if (int(As[i]) % 3)*(int(As[i]) % 5) == 0 :
			continue
		else:
			pp = "DENIED"
			break
		
# Output							
print(pp)

Submission status: Wrong Answer

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

C = True
count = 0

def check(i):
    if i % 5 == 0 or i % 3 == 0:
        return True
    else:
        return False   
if len(A) <= N:       
    for i in A :
        if i % 2 == 0:
            validation =  check(i)
            if validation == False:
                C = False
                break
        else:
            count = count + 1
    if count == len(A):
        C = False 
else:
    C = False

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

Submission status: Wrong Answer

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

approved = True

for i in integers[0:N]:
    if i%2==0:
        gusus.append(i)

for i in gusus:
    if i%3==0 and (not i%15==0):
        pass
    elif i%5==0 and (not i%15==0):
        pass
    else:
        approved=False
        break

if len(gusus)==0:
    approved=False

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

position = 0

for x in B:
  if x % 2 == 0 and (x % 3 == 0 or x % 5 == 0):
    position = position + 1
    continue
  elif x % 2 != 0:
    B.pop(position)
    position = position + 1
    continue
  elif x % 2 == 0 and (x % 3 != 0 and x % 5 != 0):
    print('DENIED')
    break
    

if(len(B)) == 0:
  print('DENIED')
else:
  print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int , input().split()))
B = []
acount = 0
bcount = 0
for i in A:
    if i % 2 == 1:
         pass
    else:
        acount += 1
        B.append(i)
if len(B) > 0:
    for i in B:
        if i % 3 == 0 or i % 5 == 0:
             bcount += 1
if N == 0:
    print('DENIED')
elif N != len(A):
    print('DENIED')
elif acount == 0:
    print('DENIED')
elif acount == bcount:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
a = input()
b = [int(str) for str in input().split() if int(str)%2 ==0]
c = "approved"
for i in b:
    if i%3 != 0 and i%5 != 0:
        c = "denied"

print(c)

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    A = list(map(int,input().split()))
    a = []
    Q = 0
    L = 0
    for g in range(N):
        d = A[g]
        D = d % 2
        if D == 0 :
            a.append(d)
    _a = len(a)
    for X in range(_a) :
        x = a[X]
        K = x % 3
        s = x % 5
        if K == 0 or s == 0 :
            Q += 1
        else :
            L += 1
    if L < 1:
        if Q >= 1:
            print('APPROVED')
    else:
        print('DENIED')
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    A = list(map(int,input().split()))
    a = []
    Q = 0
    L = 0
    for g in range(N):
        d = A[g]
        D = d % 2
        if D == 0 :
            a.append(d)
    _a = len(a)
    for X in range(_a) :
        x = a[X]
        K = x % 3
        s = x % 5
        if K == 0 or s == 0 :
            Q += 1
        else :
            L += 1
    if L < 1:
        if Q >= 1:
            print('APPROVED')
    else:
        print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int , input().split()))
B = []
acount = 0
bcount = 0
for i in A:
    if i % 2 == 1:
         pass
    else:
        acount += 1
        B.append(i)
if len(B) > 0:
    for i in B:
        if i % 3 == 0 or i % 5 == 0:
             bcount += 1
if N == 0:
    print('DENIED')
elif acount == 0:
    print('DENIED')
elif acount == bcount:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

approved = True

for i in integers[0:N]:
    if i%2==0:
        gusus.append(i)

for i in gusus:
    if i%3==0:
        pass
    elif i%5==0:
        pass
    else:
        approved=False
        break

if len(gusus)==0:
    approved=False

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

Submission status: Wrong Answer

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

ans = "DENIED"
andflg = 1

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

print(ans)

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    A = list(map(int,input().split()))
    a = []
    Q = 0
    L = 0
    for g in range(N):
        d = A[g]
        D = d % 2
        if D == 0 :
            a.append(d)
    _a = len(a)
    for X in range(_a) :
        x = a[X]
        K = x % 3
        s = x % 5
        if K == 0 or s ==5 or s == 0 :
            Q += 1
        else :
            L += 1
    if L < 1:
        if Q >= 1:
            print('APPROVED')
    else:
        print('DENIED')
resolve()

Submission status: Wrong Answer

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

C = True
count = 0

def check(i):
    if i % 5 == 0 or i % 3 == 0:
        return True
    else:
        return False   
        


for i in A :
    if i % 2 == 0:
        validation =  check(i)
        if validation == False:
            C = False
            break
    else:
      count = count + 1
if count == len(A):
     C = False 

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int , input().split()))
B = []
acount = 0
bcount = 0
for i in A:
    if i % 2 == 1:
         pass
    else:
        acount += 1
        B.append(i)
if len(B) > 0:
    for i in B:
        if i % 3 == 0 or i % 5 == 0:
             bcount += 1
if acount == 0:
    print('DENIED')
elif acount == bcount:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

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



def check(i):
    if i % 5 == 0 or i % 3 == 0:
        return True
    else:
        return False   
        
B = []
C = False
count = 0

for i in A :
    if i % 2 == 0:
        validation =  check(i)
        if validation == False:
            C = False
            break
        else:
            C = True 
    else:
      count = count + 1
if count == len(A):
     C = False 

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

Submission status: Wrong Answer

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

lst_0 = [e for e in a if e % 2 == 0]
ans = [e for e in a if e % 2 == 0]
tmp = []
while lst_0:
    e = lst_0.pop()
    if e % 3 == 0:
        tmp.append(e)

while tmp:
    lst_0.append(tmp.pop())

tmp = []
while lst_0:
    e = lst_0.pop()
    if e % 5 == 0:
        tmp.append(e)

while tmp:
    lst_0.append(tmp.pop())

if lst_0 == []:
    print('DENIED')
else:
    print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int , input().split()))
B = []
acount = 0
bcount = 0
for i in A:
    if i % 2 == 1:
         pass
    else:
        acount += 1
        B.append(i)
for i in B:
    if i % 3 == 0 or i % 5 == 0:
         bcount += 1
if acount != bcount:
    print('DENIED')
elif acount == 0:
    print('DENIED')
else:
    print('APPROVED')

Submission status: Wrong Answer

Solution code:
a = int(input())
 
b=list(map(int, input().split())) 
x = 0
c = 0
    
for i in b:
  if (i % a == 0) and (i % 2 == 0):
    x += 1

for t in b:
  if (t%2==0):
    c += 1;

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

Submission status: Wrong Answer

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



def check(i):
    if i % 5 == 0 or i % 3 == 0:
        return True
    else:
        return False   
        
B = []
C = False
count = 0

for i in A :
    if i % 2 == 0:
        validation =  check(i)
        if validation == False:
            break
        else:
            C = True 
    else:
      count = count + 1
if count == len(A):
    print("DENIED")
else:
    if C:
        print("APPROVED")
    else:
        print("DENIED")

Submission status: Wrong Answer

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

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

if len(even) == 0:
    print("DENIED")
    exit()

for i in even:
    if i % 3 != 0 and i % 5 != 0:
        print("DENIED")
        exit()

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]
C=[i for i in B if i%3==0]
D=[i for i in B if i%5==0]
if len(B)==len(C)+len(D):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
i1 = int(input())
i2 = list(map(int, input().split()))
    
l = []
for i in range(i1):
  if i2[i] % 2 == 0:
    if i2[i] % 3 == 0 or i2[i] % 5 == 0:
        l.append('APPROVED')
    else:
        l.append('DENEID')
    break
    
if (all(str == 'APPROVED' for str in l)):
	print('APPROVED')
else:
  	print('DENIED')

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    A = list(map(int,input().split()))
    a = []
    Q = 0
    L = 0
    for g in range(N):
        d = A[g]
        D = d % 2
        if D == 0 :
            a.append(d)
    _a = len(a)
    for X in range(_a) :
        x = a[X]
        n = x //10
        if n < 1:
            K = x % 3
            if K == 0 or x ==5 or x == 0 :
                Q += 1
            else :
                L += 1

        elif n >= 1 :
            s = str(x)
            h = int(s[-1])
            H = int(s[-2])
            S = h + H
            k = S % 3
            if k == 0 or h ==5 or h == 0 :
                Q +=1
            else:
                L += 1
    if L < 1:
        if Q >= 1:
            print('APPROVED')
    else:
        print('DENIED')
resolve()

Submission status: Wrong Answer

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

odd = 0
flag = 0

for n in A:
    if (n % 2) == 0:
        flag = 1
        if (n % 3) == 0 or (n % 5) == 0:
            odd += 1
        else:
            print("DENIED")
            exit()

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

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 and i %5 != 0:

            print("DENIED")

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