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 = map(int, input().split())
result = 'APPROVED'
for a in A:
  if a % 2 == 1:
    continue
  if a % 2 == 0:
    if a % 3 != 0 or a % 5 != 0:
      result = 'DENIED'
      break
print(result)

Submission status: Wrong Answer

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
    elif i % 5 != 0:
      ans = 'DENIED'
      break
 
 
print(ans)

Submission status: Wrong Answer

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

for i in a:
  if i % 2 == 0:
    if i % 3 != 0 or i % 5 != 0:
      ans = 'DENIED'
      break

print(ans)

Submission status: Wrong Answer

Solution code:
d=input()
a=list(map(int,input().split()))
rt=0
for i in a:
  if i%2==1:
    pass
  else:
    if i%3==0 | i%5==0:
      rt=1
    else:
      rt=0
      print("DENIED")
      break
if rt==1:
  print("APPROVED")

Submission status: Wrong Answer

Solution code:
d=input()
a=list(map(int,input().split()))
rt=0
for i in a:
  if i%2==1:
    pass
  else:
    if i%3==0 & i%5==0:
      rt=1
    else:
      rt=0
      print("DENIED")
      break
if rt==1:
  print("APPROVED")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = input() # 2 ~ 99
an = [int(x.strip()) for x in input().split(' ')]

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = input() # 2 ~ 99
an = [int(x.strip()) for x in input().split(' ')]

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = input() # 2 ~ 99
an = [int(x.strip()) for x in input().split(' ')]

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

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

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

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

Submission status: Wrong Answer

Solution code:
input().splitlines()
a = list(map(int, (input().splitlines())[0].split()))
b = []
for i in range(len(a)):
  if (a[i] % 2) == 0:
    if (((a[i] % 3) == 0) or ((a[i] % 5) == 0)):
      b.append(True)
    else: 
      b.append(False)
if (len(b) == 0) or (False in b):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
N=int(input())
s=input().strip().split()
for j in range (N):
  n=int(s[j])
  if n %2 ==0:
    if n % 3 != 0 or n % 5 != 0:
      print("DENIED")
      break
  print("APPROVED")
  break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
a.pop(0)
b = []
for i in range(len(a)):
  if (a[i] % 2) == 0:
    if (((a[i] % 3) == 0) or ((a[i] % 5) == 0)):
      b.append(True)
    else: 
      b.append(False)
if (len(b) == 0) or (False in b):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
s=input().strip().split()
for j in range (N):
  n=int(s[j])
  z=int('0')
  if (n-z) %2 ==0:
    if (n-z) % 3 != 0 and (n-z) % 5 != 0:
      print("DENIED")
      break
  print("APPROVED")
  break

Submission status: Wrong Answer

Solution code:
n = int(input())
a = tuple(map(int, input().split()))
deny = False
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: Wrong Answer

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

listdir = []
for i in b:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      listdir.append(i)

if len(listdir) >= 1:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
FLG=1

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

for i in range(N):
  if n[i]/2 == 0:
    if n[i]/3 != 0:
      FLG=0
    if n[i]/5 != 0:
      FLG=0
   
if FLG == 0:
  ans = "DENIED"
else:
  ans = "APPROVED"

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
FLG=1

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

for i in range(N):
  if n[i]/2 == 0:
    if n[i]/3 != 0:
      FLG=0
    elif n[i]/5 != 0:
      FLG=0
   
if FLG == 0:
  ans = "DENIED"
else:
  ans = "APPROVED"

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
Nx = input().split()
g = []
for x in Nx:
    x = int(x)
    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: Wrong Answer

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


B=[]

for i in range(N):
    if A[i]%2==1:
        B.append(0)
    elif A[i]%3==0:
        B.append(0)
    elif A[i]%5==0:
        B.append(0)
    else:
        B.append(1)

T = sum(B)
print(T)
if T==0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
n=int(input())

a=list(map(int,input().split()))
b=0
for i in range(len(a)-1):
    if a[i]//2==0:
        if a[i]//3==0 or a[i]//5==0:
            b=b+1
    else:
        b=b+1

if b==n:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
n=int(input())
flag=0

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

flg = True
for i in range(n):
    if lst[i]%2!=0:
        continue
    if lst[i]%3!=0 or lst[i]%5!=0:
        flg = False
        break
print('APPROVED' if flg else 'DENIED')

Submission status: Wrong Answer

Solution code:
def ApproveOrDeny(number_list):
  for num in number_list:
    if num % 2 == 0:
      if num % 3 != 0:
        return 'DENIED'
      if num % 5 != 0:
        return 'DENIED'
  return 'APPROVED'

N = int(input())
number_list = list(map(int, input().split()))
print (ApproveOrDeny(number_list))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(int(x) for x in input().split())
found = True

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

if found:
    print('APPRPVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
inp = input().split()
def check(n, inp):
    for i in range(n):
        num = int(inp[i])
        if ((num%2) == 0):
            if ((num%3) == 0):
                break
            if ((num%5) == 0):
                break
            return 1
    return 0
judge = check(n, inp)
if judge ==1:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

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

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

if app == True:
    print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=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: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

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

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

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

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('DENIED')
      break
    elif i != N:
      continue
    else:
      print('APPROVED')

Submission status: Wrong Answer

Solution code:
N = int(input())

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

n=0

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

if n==0:
    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):
    a=A[i]
    if a%2==0 and (a%3!=0 or a%5!=0):
        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 and A[i] % 5 != 0:
      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):
    a=A[i]
    if a%2==0 and (a%3!=0 or a%5!=0):
        print("DENIED")
        break

print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
arr = list(map(int, input().split()))
flag = 0
for i in range(n):
  num = arr[i]
  if num % 2 == 0:
    if (num % 6 == 0) or (num % 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()))

l = []
for x in a:
  if x % 2 == 0:
    if x % 3 == 0 or x % 5 == 0:
      l.append('ok')
    else:
      l.append('no')

if set(l) == {'ok'}:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Wrong Answer

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

for x in a:
  if x % 2 == 0:
    if x % 3 == 0 and x % 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 a :
    if i%2 == 0 :
        if i%3 != 0 and i%5 != 0 :
            print('DENIED')
            break
    else:
        print('APPOVED')
        break

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:
        if l[i] % 3 == 0:
          cnt += 1
        elif l[i] % 5 == 0:
          cnt += 1
    else:
        print("DENIED")
        quit()
print("APPROVED")

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:
    if l[i] % 3 == 0:
      cnt += 1
    elif l[i] % 5 == 0:
      cnt += 1
  else:
    print("DENIED")
print("APPROVED")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Solution code:
N, A = input(), input()

N, tmp = int(N), A.split()

if len(tmp) != N:
    print("DENIED")
    SystemExit()

for i in tmp:
    if int(i) % 3 == 0 or int(i) % 5 == 0:
        print("APPROVED")
    else:
        print("DENIED")

Submission status: Wrong Answer

Solution code:
def solve():
    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('APPROVED')
                exit()
    print('DENIED')


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

odd_count = 0
flag = 0

for i in range(N):
  if A[i] %2 == 0:
    if A[i] %3 == 0 or A[i] % 5 == 0:
      flag += 0
    else:
      flag += 1
  else:
    odd_count += 1

if odd_count == N:
  print('DENIED')

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import numpy as np
stdin = open(0)

A = np.fromstring(stdin.read(),np.int64,sep= ' ')[1:]
A=A[A%2 ==0]
if np.all((A % 3 == 0)|(A % 5 ==0)):
    print('APPROVED')
else:
    print('DENITED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print("DENIED")

Submission status: Wrong Answer

Solution code:
def solve(n, a):
    for i in range(n):
        if a[i] % 2 == 0:
            if not 0 in [a[i] % 3, a[i] % 5]:
                return "DEFINED"
    return "APPROVED"

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

def result():


    input_first = input().split()
    input_second = input().split()

    N= input_first
    paper = [int(i) for i in input_second]


    for num in paper:
        if num%2 ==0 and num%3!=0 or num %5 != 0:
            print('DENIED')
            return 

    print('APPROVED')



result()

Submission status: Wrong Answer

Solution code:
import sys

def result():


    input_first = input().split()
    input_second = input().split()

    N= input_first
    paper = [int(i) for i in input_second]


    for num in paper:
        if num%2 ==0 and num%3==0 or num %5 == 0:
            print('APPROVED')
            return 

    print('DENIED')



result()

Submission status: Wrong Answer

Solution code:
import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random
from io import BytesIO, IOBase
from bisect import bisect_left

 
#########################
# imgur.com/Pkt7iIf.png #
#########################
 
def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r
 
def divs(n, start=1):
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors
 
def divn(n, primes):
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t
 
def flin(d, x, default=-1):
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return (default, default)
    else:
        return (left, right)
 
def ceil(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def dd(): return collections.defaultdict(int)
def ddl(): return collections.defaultdict(list)
 
 
# region fastio
 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
	newlines = 0
 
	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = "x" in file.mode or "r" not in file.mode
		self.write = self.buffer.write if self.writable else None
 
	def read(self):
			while True:
					b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
					if not b:
							break
					ptr = self.buffer.tell()
					self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
			self.newlines = 0
			return self.buffer.read()
 
	def readline(self):
			while self.newlines == 0:
					b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
					self.newlines = b.count(b"\n") + (not b)
					ptr = self.buffer.tell()
					self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
			self.newlines -= 1
			return self.buffer.readline()
 
	def flush(self):
			if self.writable:
					os.write(self._fd, self.buffer.getvalue())
					self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
	def __init__(self, file):
			self.buffer = FastIO(file)
			self.flush = self.buffer.flush
			self.writable = self.buffer.writable
			self.write = lambda s: self.buffer.write(s.encode("ascii"))
			self.read = lambda: self.buffer.read().decode("ascii")
			self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
 
# endregion
n=ii()
a=li()
flag=0
for i in range(n):
    if a[i]%6==0 or a[i]%10==0:
        flag=1
    else:
        flag=0
        break
if flag==1:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
p = 'DENIED'

for i in map(int, input().split()):
  print(i)
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      print('DENIED')
      sys.exit()
    elif i % 3 == 0 or i % 5 == 0:
      p = 'APPROVED'
print(p)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
p = 'DENIED'

for i in map(int, input().split()):
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      print('DENIED')
      sys.exit()
    elif i % 3 == 0 or i % 5 == 0:
      p = 'APPROVED'
print(p)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
p = 'DENIED'

for i in map(int, input().split()):
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      print('DENIED')
      sys.exit()
    elif i % 3 == 0 or i % 5 == 0:
      p = 'APPROVED'
      continue
  else:
    continue
print(p)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
p = 'DENIED'

for i in map(int, input().split()):
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      print('DENIED')
      sys.exit()
    else:
      p = 'APPROVED'
      continue
  else:
    continue
print(p)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
p = 'DENIED'

for i in map(int, input().split()):
  #a = int(input())
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      p = 'DENIED'
      sys.exit()
    else:
      p = 'APPROVED'
      continue
  else:
    continue
print(p)

Submission status: Wrong Answer

Solution code:
N = int(input())
p = 'DENIED'

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines  

N = input()
A = list(map(int, input().split()))
A = [a for a in A if a%2 == 0]

if len(A) == 0:
  print("DENIED")
  exit()
ans = 0
for a in A:  
    if a % 3 == 0 or a % 5 == 0:
      ans += 1
    
print("APPROVED" if len(A) == ans else "DENIED")

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines  

N = input()
A = list(map(int, input().split()))
A = [a for a in A if a%2 == 0]

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines  

N = input()
A = list(map(int, input().split()))
A = [a for a in A if a%2 == 0]

for a in A:  
    if a % 3 != 0 and a % 5 != 0:
      print("DENIED")
      exit()
    
print("APPROVED" if len(A) != 0 else "DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
input()
for a in map(int,input().split()):
  if a&1: continue
  if a%3 or a%5: continue
  print("DENIED")
  exit()
print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
list_ = [int(x) for x in input().split() if (int(x) % 2) == 0]
for f in list_:
    if (f % 3 == 0) or (f % 5 == 0):
        continue
    else:
        print("DENIED")
        break
else:
    print("APPROVED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

flag = True

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