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: Runtime Error

Solution code:

#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <cmath>
#include <string>
#include <sstream>
#include <queue> 
#include <list>
#include <stack>
#include <unordered_map>
#include <algorithm> 
#include <numeric>  
#include <functional>
#include <cassert>
#include <bitset>
#include <cctype>  
#include <iomanip> 
#include <limits>  
#include <regex>
// std::numeric_limits<int>::max(), min()
// std::setprecision(X)
// std::islower(), std::isupper(), std::tolower, std::toupper
// std::accumulate(m.begin(), m.end(), 0LL);
// std::sort(begin(),end()) // 0, 1, 2, 3 ,4 (default, less);
// std::priority_queue<int, vector<int>, less<int>> que; // 4, 3, 2, 1 (defualt, less) : 
// if ( std::regex_match(S, std::regex("(dream|dreamer|erase|eraser)*")) ) std::cout << "YES" << std::endl;
 
#define rep(i, n) for(int i = 0; i < (int)(n);    i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<std::vector<int>> vvi;

ll gcd ( ll a, ll b ) { if ( b == 0 ) return a; else return gcd ( b, a%b ); }
ll lcm ( ll a, ll b ) { return a * b / gcd(a, b); }


int main (void) {
  std::cin.tie(0);  std::ios::sync_with_stdio(false);

  return 0;
}

Submission status: Runtime Error

Solution code:
li = list(map(int,input().split()))
error = 0
for i in range(li[0]):
  if i == 1:
  else:
    if li[i]%2 == 0:
      if li[i]%3 == 0 or li[i]%5 ==0:
      else:
        error = 1:
    else:
if error:
  print('DENIED')
else:
  print('APPROVED')

Submission status: Runtime Error

Solution code:
num=input()
x=[]
for i in range(int(num)):
  x.append(int(input().split()))
  if x[i]%2==0 and (x[i]%2==3 or x[i]%5==0):
    print("APPROVED")
  else:
    print("DENIED")

Submission status: Runtime Error

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

for i in range(N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0:
            continue
        elif A[i] % 5 == 0:
            continue
        else:
            print('DENIED')
            sys.exit()
print('APPROVED')

Submission status: Runtime Error

Solution code:
N = int(input())
numbers = list(map(int, input().split()))
for number in nunbers:
  if number % 2 == 0:
    if number % 3 != 0 or number % 5 != 0:
      print("DENIED")
      break
print("APPROVED")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

for i in range(N):
  if a[i] % 2 == 0:
    if a[i] % 3 != 0 or a[i] % 5 != 0:
      b = 1
      break
if b == 0:
  print("APPROVED")
else:
  print("DENIDED")

Submission status: Runtime Error

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

for i in range(N):
  if a[i] % != 2:
    if a[i] % != 3 or a[i] % != 5:
      b = 1
      break
if b == 0:
  print("APPROVED")
else:
  print("DENIDED")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = input()
numList = input()


for num in numList:
  if num % 2 == 0:
    judge1 = num % 3 == 0
    judge2 = num % 5 == 0
    approve = judge1 or judge2
    if not approve:
      print('DENIED')
      exit()
print('APPROVED')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = list(map(int, input().split()))
N = int(input())
count = 0
for a in A:
 if (a % 2 == 0 and a % 3 != 0) and (a % 2 == 0 and a % 5 != 0):
   count = count + 1

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

Submission status: Runtime Error

Solution code:
A = list(map(int, input().split()))
N = int(input())
count = 0
for a in A:
  if (a % 2 == 0 and a % 3 != 0) and (a % 2 == 0 and a % 5 != 0):
    count = count + 1

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

Submission status: Runtime Error

Solution code:
A = list(map(int, input().split()))
count = 0
for a in A:
  if (a % 2 == 0 and a % 3 != 0) and (a % 2 == 0 and a % 5 != 0):
    count = count + 1

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

Submission status: Runtime Error

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

for i in range(n):
  if  a[i] % 2 == 0 and (a[i] % 3 == 0 or a[i] % 5 == 0):
    print("APPROVED")
    exit()
else:
  print("DENIDE")

Submission status: Runtime Error

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

for i in range(n):
  if not a[i] % 2 == 0 and (a[i] % 3 == 0 or a[i] % 5 == 0):
    print("DNIDED")
    exit()
else:
  print("APPROVED")

Submission status: Runtime Error

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

for i in range(n):
  if not a[i] %= 2 and (a[i] %= 3 or a[i] %= 5):
    print("DNIDED")
    exite()
else:
  print("APPROVED")

Submission status: Runtime Error

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

flag = 0

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      flag = 1
      break
    else:
      continue
      
if flag = 0:
  print('APPROVED')

Submission status: Runtime Error

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

Submission status: Runtime Error

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:
            ans = 'APPROVED'
        else:
            ans = 'DENIED'
            break
print(ans)

Submission status: Runtime Error

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:
            ans = 'APPROVED'
        else:
            ans = 'DENIED'
            break
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np

n = int(input())
arrA = np.array(input().split(),dtype=np.int64)

filter = (arrA % 2 == 0)
if len(arrA[filter])==0:
    ans == "APPROVED"
else:
    for i in arrA[filter]:
        if i%3==0 or i%5==0:
            ans = "APPROVED"
        else:
            ans = "DENIED"
            break

# APPROVED or DENIED
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np

n = int(input())
arrA = np.array(input().split(),dtype=np.int64)

filter = (arrA % 2 == 0)
for i in arrA[filter]:
    if i%3==0 or i%5==0:
        ans = "APPROVED"
    else:
        ans = "DENIED"
        break

# APPROVED or DENIED
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input().split())
for i in range(N):
    if A[i]%2==0:
        if A[i]%15!=0:
            print("DENIED")
        else:
            print("APPROVED")

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input().split())
for i in range(N):
    print(i)
    print(A[i])
    if A[i]%2==0:
        if A[i]%15!=0:
            print("DENIED")
        else:
            print("APPROVED")

Submission status: Runtime Error

Solution code:
n=int(input())
a=[int(x) for x in input().input()]
flg=0
for x in a:
  if x%2==0 and x%3 and x%5:
    flg=1
if flg:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Runtime Error

Solution code:
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)
function main()
    flg=true
    n=parseInt(readline())
    a=parseMap(split(readline()))
    for i in a
        if i%2==0 && i%3 * i%5!=0
            flg=false
            break
        end
    end
    print(ifelse(flg,"APPROVED","DENIED"))
end
main()

Submission status: Runtime Error

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

for i in li:
  if i%2 ==0:
    if i%3 == 0 or i%5 == 0:
    else:
      print('DENIED')
      break
  print('APPROVED')

Submission status: Runtime Error

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

for i in li:
  if i%2 ==0:
    if i%3 == 0 or i%5 == 0:
    else:
      print('DENIED')
      break

print('APPROVED')

Submission status: Runtime Error

Solution code:
    n=int(input())
    a = list(map(int,input().split()))
    even=[el for el in a if el % 2==0]
    try:
      for a in even:
        if a % 3 == 0 or a % 5 == 0:
          flg = 1
        else:
          raise
    except:
      print('DENIED')
    else:
      print('APPROVED')

Submission status: Runtime Error

Solution code:
number = map(int, input().split())
if (number % 2 == 0 and number % 3 == 0) or (number % 2 == 0 and number % 5 == 0):
    print("APPROVED")
else:
    print("DENIED")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
 
numbers = list(map(int, input().split(' ')))
approved = False
 
for num in numbers:
  if (num % 2 == 0):
  	if (num % 3 == 0) or (num % 5 == 0):
      approved = True
      continue
  	else:
      approved = False
      print('DENIED')
      break
if approved:
  print('APPROVED')

Submission status: Runtime Error

Solution code:
n = int(input())
 
numbers = list(map(int, input().split(' ')))
approved = False
 
for num in numbers:
  if (num % 2 == 0):
  	if (num % 3 == 0) or (num % 5 == 0):
    	approved = True
    	continue
  	else:
    	approved = False
    	print('DENIED')
    	break
if approved:
  print('APPROVED')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

numbers = map(int, input().split(' '))
approved = False

for num in numbers[1::2]:
  if (num % 3 == 0) or (num % 5 == 0):
    approved = True
    continue
  else:
    approved = False
    print('DENIED')
    break
if approved:
  print('APPROVED')

Submission status: Runtime Error

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

isApprove = True

for x in A:
    if x % 2 == 0:
        if (x % 3 != 0) or (x % 5 != 0):
            isApprove = True
            print('DENIED')
            return 

print ('APPROVED')

Submission status: Runtime Error

Solution code:
x=list(map(int, input().split()))
false=0

for i in range(1,x[0]+1):
    if x[i]%2 == 0:
        if x[i]%3 != 0 and x[i]%5 != 0:
            false=false+1
if false==0:
	print('APPROVED')
else:
	print('DENIED')

Submission status: Runtime Error

Solution code:
x=list(map(int, input().split()))
false=0

for i in range(1,x[0]):
    if x[i]%2 == 0:
        if x[i]%3 != 0 or x[i]%5 != 0:
            false=false+1
if false!=1:
	print('APPROVED')
else:
	print('DENIED')

Submission status: Runtime Error

Solution code:
x=list(map(int, input().split()))
false=0

for i in range(1,len(x)):
	if x[i]%2 ==0:
    	if x[i]%3!=0 or x[i]%5!=0
        	fasle=1
if false==1:
	print('APPROVED')
else:
	print('DENIED')

Submission status: Runtime Error

Solution code:
n = int(input())

A = list(map(int, input().split()))
for i in range(n):
    if A%2 == 0 and A%3 == 0:
        print("APPROVED")
    elif A%2 == 0 and A%5 == 0:
        print("APPROVED")
    else:
        print("DENIED")

Submission status: Runtime Error

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

count=0
  
for i=0 in range(N):
  if A[i]%2==0:
    if A[i]%3==0 or A[i]%5==0:
      print('APPROVED')
      count=1
      break
  elif:
    continue
    
if count=0:
  print('DENIED')

Submission status: Runtime Error

Solution code:
N = int(input())
b = []
for i in range(N):
  a = int(input())
  b.append(a)
    
for i in b:
  B = i%2
  if B==0:
    print(i)
    if i%3 == i%5 and i>=6:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
N = int(input())
b = []
for i in N:
  a = int(input())
  b.append(a)
    
for i in b:
  B = i%2
  if B==0:
    if i%3 == i%5:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
import sys
a = []
for l in sys.stdin:
    a.append(int(l))
    
for i in a:
  B = i%2
  if B==0:
    if i%3 == i%5:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
N = int(input())
A = [int(input(x)) for x in range(N) ]
for i in A:
  B = i%2
  if B==0:
    if i%3 == i%5:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

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

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

Submission status: Runtime Error

Solution code:
import numpy as np
 
N = int(input())
l = map(int,input().split())
a = np.array(l)
count = 0
 
for i in range(len(a)):
    if a[i]%6 == 0 or a[i]%10 == 0:
        count += 1
    
if count:
    print("APPROVE")
else:
    print("DENIED")

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
l = map(int,input().split())
a = np.array(l)
count = 0

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

if count:
  print("APPROVE")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
N = int(input())
l = map(int,input().split())
a = np.array(l)
count = 0

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

if count:
  print("APPROVE")
else:
  print("DENIED")

Submission status: Runtime Error

Solution code:
n = int(input())
A = map(int, input.split())
result = 'APPROVED'
for a in A:
  if a % 2 == 1:
    continue
  elif a % 3 != 0 and a % 5 != 0:
    result = 'DENIED'
    break
print(result)

Submission status: Runtime Error

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


print(ans)

Submission status: Runtime Error

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

for i int range(len(m))
    if i % 2 == 0:
        if i % 5 == 0 or i % 3 == 0:
            ans = 'APPROVED'
        else:
            ans = 'DENIED'

print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
# 1以上N以下の整数のうち、10進法での各桁の和が
# A以上B以下であるものの総和を求めてください。
n = input() # 2 ~ 99
an = []
an = input().split() 1 ~ 1000

ocunt = 0
for i in an:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      count += 1
      break:
if count == 1:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Runtime Error

Solution code:
n = int(input())
a = tuple(map(int, input().split()))
deny = False
if len(a) == n:
    continue
else:
    pass
for i in a:
    if i % 2 != 0:
        continue
    elif (i % 3) == 0 or (i % 5) == 0:
        continue
    elif i % 2 == 0:
        print("DENIED")
        deny = True
        pass
if deny is False:
    print("APPROVED")

Submission status: Runtime Error

Solution code:
n = int(input())
s = [int(x) for x in list(input().split()) if x%2 == 0]
ans = "APPROVED"
for i in s:
  if not i%5 != 0 && i%3 != 0:
    ans = "DENIED"
    pass
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
Nx = input().split()
g = []
for x in Nx:
    if x % 2 == 0:
        g.append(x)

for i in g:
    if not i % 3 == 0:
        if not i % 5 == 0:
            print("DENIED")
            break
    else:
        continue
    print("APPROVED")

Submission status: Runtime Error

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

for i in c:
  if i%2 == 0:
    if i%3 == 0 or i%5 == 0:
      print('APPROVED')
    else('DENIED')
    
  else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
N = int(input())
I = [map(int, input().split())]
i = 0
j = 0
while i < N:
  if I[i] / 2 == I[i] // 2:
    if I[i] / 3 == I[i] // 3 or I[i] / 5 == I[i] // 5:
      j = j + 0
      i = i + 1
    else:
      j = j + 1
      i = i + 1
  else:
    i = i + 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
s = [int(input()) for _ in range(N)]
cond = True
for i in s:
  if i%2 == 0:
    if i%3 == 0 or i%5 == 0:
      continue
    else:
      cond = False
      break
if cond is True:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Runtime Error

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

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

print('APPROVED')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
nums = list(map(int, input().split()))
chk = True
for i in nums:
    if i%2==0:
        if i%3==0 and i%5==0:
            pass
        else:
            chk = False:
    else:
        pass
if chk == True:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Runtime Error

Solution code:
N = int(input())

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

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

print("APPROVED")

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
int n = input()
arr = []
arr = list(map(int, input().split()))
for i in range(n):
  num = arr[i]
  if num % 2 == 0:
    if (num % 6 == 0) or (num % 10 == 0):
      print("APPROVED")
    else:
      print("DENIED")

Submission status: Runtime Error

Solution code:
n=int(input())
arr=input.split()
den=0
app=0
for i in arr:
  i=int(i)
  if (i%2):
    if i%3==0 or i%5==0:
      app+=1
    else:
      den+=1
if den>0:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Runtime Error

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

Submission status: Runtime Error

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')
            break
else:
    print('APPOVED')
    break

Submission status: Runtime Error

Solution code:
inputs = map(int, input().split(" "))

is_denied = False
for i in inputs:
  if i % 2 ==0:
    if i % 3 != 3 or i % 5 != 5
    	is_denied = True
      
if is_denied:
  print("DENIED")
else:
  print("APPROVED")

Submission status: Runtime Error

Solution code:
inputs = map(int, input.split(" "))

is_denied = False

for i in inputs:
  if i % 2 ==0:
    if i % 3 != 0 or i % 5 == 0:
      is_denied = True
      

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(0,n):
    if lst[i]%2==0:
        if lst[i]%3==0 or lst[i]%5==0:
            x=1
            
        else: x=0
if x==1:print("APPROVED")
else: print("DENIED")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
Ai = input()
Ai = Ai.split(' ')
ans = 'APPROVED'
for moji in Ai:
    if moji % 2 != 0:
        pass
    else:
        if (moji % 3 == 0) or (moji % 5 == 0):
            pass
        else:
            ans = 'DENIED'
            break
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input()
nums = [int(n_str) for n_str in input().split(' ')]

for num in nums:
  if num % 2 == 0:
    if num % 3 != 0 and num % 5 != 0:
      print("DENIED")
	  exit()

print("APPROVED")

Submission status: Runtime Error

Solution code:
input()
l = [*map(int, input().split())]
l = [i for i in l if i % 2 == 0]
for i in l:
    if i % 3 != 0 and i % 5 != 0:
        print("DENIED")
        exit()
print("APPROVED")

Submission status: Runtime Error

Solution code:

num = input()
a = input().split()
flag = 0
for item in a:
    if item%2==0:
        if item%3==0 or item%5==0:
            pass
        else:
            flag=1

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

Submission status: Runtime Error

Solution code:
n = int(input())
list = [int(x) for x in input().split(" ")]
result = 'APPROVED'
for i in range(len(list)):
    if list[i]%2 == 0:
        if list[i]%3!=0 AND list[i]%5!=0:
            result = 'DENIED'
            break
print(result)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
A = []
for i in range(0, n) :
	temp = int(input())
	A.append(temp)
flag = True
for i in range(0, n) :
	if A[i] % 2 != 0 :
		continue
	elif A[i] % 2 == 0 and (A[i]%3 == 0 or A[i]%5 == 0) :
		continue
	else :
		flag = False
		break
if flag :
	print ("APPROVED")
else :
	print ("DENIED")

Submission status: Runtime Error

Solution code:
n = int(input())
a = map(int, input().strip().split())
for number in a:
    if number%2==0:
        if number%3==0 or number%5==0:
            flag = 1
            continue
        else:
            flag = 0
            print('DENIED')
            break
if flag == 1:
    print('APPROVED')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in l:
	if(i%2==0):
      if(i%3!=0 and i%5!=0):
        f=1
        print("DENIED")
if(not f):
  print("APPROVED")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
arr = [input() for _ in range(n)]
dic = {}
for i in range(n):
    if arr[i] not in dic:
        dic[arr[i]] = 1
    else:
        dic[arr[i]] += 1
largest = max(dic.values())
ans = []
for keys in dic.keys():
    if dic[keys] == largest:
        ans.append(keys)
ans = sorted(ans)
for words in ans:
    print(words)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
even = []
approved = True
for i in A:
    if i%2 == 0:
        even.append(i)
for j in even:
    if j%3 == 0 or j%5 == 0:
    else:
        approved = False
        break
if approved:
    print('APPROVED')
else:
    print('DENIED')