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:
p = input()
b = map(int,raw_input().split())
# a = sum(map(int,raw_input().split()))
r = "APPROVED"
for i in b:
    if i%3!=0 or i%5!=0:
        r = "DENIED"
        break
print r

Submission status: Wrong Answer

Solution code:
'''input
3
28 27 24
'''
n = input()
a = map(int, input().split())

ok = 0
for i in a:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			ok = 0

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

Submission status: Wrong Answer

Solution code:
A=input().split()
x = input().split()
target ="APPROVED"
for i in x:
  if int(i)%2 == 0:
    if int(i)%3 > 0 or int(i)%5 > 0:
      target = "DENIED"
      break
print(target)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = list(map(int,input().split()))
flag = False
for i in li:
  if i % 6 == 0 or i % 10 == 0:
    continue
  else:
    print("DENIED")
    flag = True
if not flag:
  print("APPROVED")

Submission status: Wrong Answer

Solution code:
n = int(input())
li = list(map(int,input().split()))
flag = False
for i in li:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      continue
    else:
      print("DENIED")
      flag = True
if not flag:
  print("APPROVED")

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int,input().split()))
flag = False
for i in l:
  if i%2==0:
    if i%3!=0 or i%5!=0:
      flag=True
      break
if not flag:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Wrong Answer

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

for ni in range(rangeNum):
    if n[ni]%2 == 0:
        if n[ni]%3 == 0:
            continue
        elif n[ni]%5 == 0:
            continue
        else:
            print("DENIED")
            break
    else:
        continue
print("APPROVED")

Submission status: Wrong Answer

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

for ni in range(rangeNum):
    if n[ni]%2 == 0:
        if n[ni]%3 == 0:
            continue
        elif n[ni]%5 == 0:
            continue
        else:
            print("DENIED")
    else:
        continue
print("APPROVED")

Submission status: Wrong Answer

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

ans = True
for ni in range(rangeNum):
    if n[ni] % 2 == 0:
        if n[ni] % 3 == 0:
            ans = True
        elif n[ni] % 5 == 0:
            ans = True 
        else:
            ans = False
    else:
        ans = False
if ans==True:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

ans = True
for ni in range(rangeNum):
    if n[ni] % 2 == 0:
        if n[ni] % 3 == 0:
            break
        elif n[ni] % 5 == 0:
            break
        else:
            ans = False
    else:
        ans = False
if ans==True:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

ans = True
for ni in range(rangeNum):
    if n[ni] % 2 == 0:
        if n[ni] % 3 == 0:
            break
        elif n[ni] % 5 == 0:
            break
        else:
            asn = False
    else:
        asn = False
if ans:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

for ni in range(rangeNum):
    if n[ni] % 2 == 0:
        if n[ni] % 3 == 0:
            print("APPROVED")
        elif n[ni] % 5 == 0:
            print("APPROVED")
        else:
            print("DENIED")
    else:
        print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
AA = [x % 3 == 0 or x % 5 == 0 for x in A if x % 2 == 0]
if any(AA):
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

list2=[]
for i in list:
    if i%2==0:
        list2.append(i)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

list2=[]
for i in list:
    if i%2==0:
        list2.append(i)

if list2:
    while all(i%3==0 or i%5==0 for i in list2):
        print('APPROVED')
    else:
        print('DENIED')
else:
    print('DENIED')

Submission status: Wrong Answer

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

output = 'APPROVED'

for n in A:
    if (n % 2 == 0) and (n % 6 != 0) or (n % 10 != 0):
        output = 'DENIED'
        
print(output)

Submission status: Wrong Answer

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

for n in A:
    if (n % 2 == 1) or (n % 6 == 0) or (n % 10 == 0):
        print('APPROVED')
    else:
        print('DENIED')

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())

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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
i=input;N=i();print('ADPEPNRIOEVDE'[True in[a%3and a%5and a%2==0for a in list(map(int,i().split()))]::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
count=0
for i in a:
    if i%2==0:
        if i%3!=0 or i%5!=0:
            count+=1
            break
if count==0:
    print("APROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
count=0
for i in a:
    if i//2==0:
        if i//3!=0 or i//5!=0:
            count+=1
            break
if count==0:
    print("APROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
a=input()
arr = list(map(int, input().split()))
c=False
for i in arr:
	if(i%2==0):
		if(i%3==0 or i%5==0 ):
			c=True	
		else:
			c=False
			break;
if(c==True):
	print("APPROVED")	
else:
	print("DENIED")

Submission status: Wrong Answer

Solution code:
import sys
a=input()
arr = list(map(int, input().split()))
c=False
for i in arr:
	if(i%2==0):
		if(i%3==0 or i%5==0 ):
			c=True	
		else:
			print("DENIED")
			c=False
			sys.exit()	
if(c==True):
	print("APPROVED")	
else:
	print("DENIED")

Submission status: Wrong Answer

Solution code:
import sys
a=input()
arr = list(map(int, input().split()))
c=False
for i in arr:
	if(i%2==0):
		if(i%3==0 or i%5==0 ):
			c=True	
		else:
			print("DENIED")
			sys.exit()	
if(c==True):
	print("APPROVED")	
else:
	print("DENIED")

Submission status: Wrong Answer

Solution code:
import sys
a=input()
arr = list(map(int, input().split()))
c=False
for i in arr:
	if(i%2==0):
		c=True
		if(i%3==0 or i%5==0 ):
			c=True	
		else:
			print("DENIED")
			sys.exit()	
if(c==True):
	print("APPROVED")	
else:
	print("DENIED")

Submission status: Wrong Answer

Solution code:
import sys
arr = list(map(int, input().split()))
c=False
for i in arr:
	if(i%2==0):
		c=True
		if(i%3==0 or i%5==0 ):
			c=True	
		else:
			print("DENIED")
			sys.exit()	
if(c==True):
	print("APPROVED")	
else:
	print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if count == len(A):
    print('DENIED')

Submission status: Wrong Answer

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

if count == len(A):
    print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
li=list(map(int,input().split()))
even=[]
ans="APPRIVED"

for i in li:    
  if i%2==0:
    even.append(i)
    
for j in even:
  if j%3!=0 and j%5!=0:
    ans="DENIED"
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
li=list(map(int,input().split()))
even=[]

for i in li:    
  if all([i//2==1]):
    print("APPROVED")
    exit()
    
  if i%2==0:
    even.append(i)
    if all([j%3==0 or j%5==0 for j in even]):
      print("APPROVED")
      exit()
      
print("DENIED")

Submission status: Wrong Answer

Solution code:
n=int(input())
li=list(map(int,input().split()))
even=[]

for i in li:
  if i%2==0:
    even.append(i)
    
  elif all([i%2!=0]):
    print("APPROVED")
    exit()
  
  for j in even:
    if j%3==0 or j%5==0:
      print("APPROVED")
      exit()
      
print("DENIED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a2 = [x for x in a if x % 2 == 0]
if len(a2) == 0:
    print("DENIED")
    exit()

a3 = [x for x in a2 if x % 3 == 0 or x % 5 == 0]
if len(a3) == len(a2):
    print("APPROVED")
    exit()

print("DENIED")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
x = 0
for j in range(0,n):
  if not (((a[j] % 2) == 0) and (((a[j] % 3) != 0) or (a[j] % 5 != 0))):
    x = 1
if x == 1:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
x = 0
for j in range(0,n):
  if not (((a[j] % 2) == 0) and (((a[j] % 3) != 0) and (a[j] % 5 != 0))):
    x = 1
if x == 1:
  print('APPROVED')
else:
  print('DENIED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

print('DENIED' if any([x%2==0 and (x%3 and x%5) for x in map(int,input().split())]) else 'APPLOVED')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in 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
    else:
        print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
A = [int(i) for i in input().split()]
for i in A:
  if i%2 == 0 and (not i%3 == 0 or not i % 5 == 0):
    print("DENIED")
    sys.exit()
  else :
    continue
print("APPROVED")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
for i in A:
  if not i%3 == 0 or not i % 5 == 0:
    print("DENIED")
    exit()
  else :
    continue
print("APPROVED")

Submission status: Wrong Answer

Solution code:
ans = 'APROVED'

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
A = [int(i) for i in input().split()]
for i in A:
  if not i%3 == 0 or not i % 5 == 0:
    print("DENIED")
    sys.exit()
  else :
    continue
print("APPROVED")

Submission status: Wrong Answer

Solution code:
ans = 'APROVED'

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

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

print(ans)

Submission status: Wrong Answer

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

is_approved = True
for l in li :
    if (l % 2 != 0) :
        continue

    if (l % 2 == 0 and l % 3 == 0 and l % 5 == 0) :
        continue

    is_approved = False
    break

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

Submission status: Wrong Answer

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

a_even = []
for ai in a:
    if ai%2 == 0:
        a_even += [ai]

ans = "APPROVED"
for a_eveni in a_even:
    if a_eveni%3 != 0 or a_eveni%5 != 0:
        ans = "DENIED"
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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


print("APROVED")

Submission status: Wrong Answer

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

count = 0
cnt = 0

for i in A:
    if i%2 == 0:
        cnt += 1
        if i%3 == 0 or i%5 == 0:
            count += 1
        else:
            count += 0


if count == cnt:
    print("APROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

count = 0

for i in A:
    if i%2 == 0:
        if i%3 == 0 or i%5 == 0:
            count += 1
        else:
            count += 0
    else:
        count += 1


if int(count) == N:
    print("APROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
flag = 1
for i in A:
    if i%3!=0 or 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()))
B = list((i for i in A if i % 2 == 0))

count = 0

for i in B:
    if i%3 == 0 or i%5 == 0:
        count += 1
    else:
        count += 0

if int(count) == int(len(B)):
    print("APROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
cnt = 0
for i in l:
    if i % 6 == 0 or i % 10 == 0:
        cnt += 1
if cnt == n:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
n = input()
l = list(map(int, input().split()))
cnt = 0
for i in l:
    if i % 6 == 0 or i % 10 == 0:
        cnt += 1
if cnt > 0:
    print("APPROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
def k(x):
  x=int(x)
  if x%2==0 and (x%3==0 or x%5==0):
    return 1
  return 1
n=int(input());l=list(map(k,input().split()))
if sum(l)==n:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

f = True
for a in A:
  if (a&1)==0 and ((a%3==0) or (a%5==0)):
    pass
  else:
    f = False
if f:
  print("APPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
X = map(int,input().split())
def check():
    for i in range(N):
        if(i%2 == 0):
            if(i%3 == 0 & i%5 == 0):
                continue
            else:
                print("DENIED")
                return 0

        else:
            continue
    print("APPROVED")
check()

Submission status: Wrong Answer

Solution code:
N = int(input())
a_list = [int(x) for x in input().split(' ')]
a_list = list(filter(lambda x:x%2 == 0 and (x%3 != 0 and x%5 != 0), a_list))
print(a_list)

if not a_list:
    print('APPROVED')
else:
    print('DENIED')

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = list((i for i in A if i % 2 == 0))

count = 0

for i in B:
    if i%3 == 0 or i%5 == 0:
        count += 1
    else:
        count += 0

if count == len(B):
    print("APROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = list((i for i in A if i % 2 == 0))

count = 0

for i in B:
    if i%3 == 0 or i%5 == 0:
        count += 1

if count == len(B):
    print("APROVED")
else:
    print("DENIED")

Submission status: Wrong Answer

Solution code:
import sys

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

a_even = [i for i in a if i%2==0]
# print(a_even)
for x in a_even:
    if x%3==0 or x%5==0:
        pass
    else:
        print('DENIED')
        print(x)
        sys.exit()
print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = "APPROVED"
for a in A:
    if (a % 2 == 0) and (a & 3 != 0) and (a % 5 != 0):
        ans = "DENIED"
        break

print(ans)

Submission status: Wrong Answer

Solution code:
print("APPROVED" if all([n%3==0 or n%5==0 for n in map(int,input(int(input())).split()) if not n%2]) else "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 and A[i]%5 != 0:
            frag = False

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

Submission status: Wrong Answer

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

approved = True
for num in nums:
    if (num%2==0):
        if (num%3!=0 and num%5!=0):
            approved = False
            print(num)
            break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def f(n: int) -> bool:
    if n % 2 == 0:
        if n % 3 == 0 or n % 5 == 0:
            return True
        else:
            return False
    else:
        return True


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

if all(map(f, A)):
    print("APPROVED")
else:
    print("DINED")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Mar  3 23:44:02 2020

@author: Kanaru Sato
"""

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

deny = 0

for i in range(0,N):
    if A[i]%2 == 0 and (A[i]%3 != 0 and A[i]%5 != 0):
        deny = 1

if deny == 1:
    print("DENIED")
else:
    print("APRROVED")

Submission status: Wrong Answer

Solution code:
N= int(input())
flag = False
for i in range(1,10):
	for j in range(1,10):
		A=i*j
		if(A==N):
			flag=True
			break
	if flag: break
if flag:print("Yes")
else:print("No")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
for i in A:
    if not(i % 3 == 0 or i % 5 == 0):
        print("DENIED")
        break
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 or i % 5 == 0:
      continue
    else:
      print("DENIED")
      break
  else:
    continue
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 or i % 5 == 0:
      print("APPROVED")
    else:
      print("DENIED")
      break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
List = list(map(int,input().split()))
k=0
for s in List:
  if s%2==1 or s%3==0 or s%5==0:
    k+=1
if k==n:
  print("APPPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

Solution code:
n = input()
List = list(map(int,input().split()))
k=0
for s in List:
  if s%2==1 or s%3==0 or s%5==0:
    k+=1
if k==n:
  print("APPPROVED")
else:
  print("DENIED")

Submission status: Wrong Answer

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

A_even =list()

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

miss = True


for i in range(len(A_even)):
    if A_even[i]%3 == 0 or A_even[i]%5 == 0:
        pass
    else:
        miss = False
        break
if miss:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

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

A_even =list()

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

miss = False
if len(A_even) ==0:
    print("APPROVED")
else:
    for i in range(len(A_even)):
        if A_even[i]%3 == 0 or A_even[i]%5 == 0:
            pass
        else:
            miss = True
if miss:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

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

A_even =list()

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

miss = False
if len(A_even) ==0:
    print("DENIED")
else:
    for i in range(len(A_even)):
        if A_even[i]%3 == 0 or A_even[i]%5 == 0:
            pass
        else:
            miss = True
if miss:
    print("DENIED")
else:
    print("APPROVED")

Submission status: Wrong Answer

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

flag = False
even = list()

for i in range(N):
    if (A_i[i] % 2 == 0):
        even.append(A_i[i])

for i in even:
    if (i % 3 == 0 or i % 5 == 0):
        flag = True

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
for i in a:
  if i%2!=0:
    a.remove(i)
cnt=0
for j in a:
  if j%3!=0 and j%5!=0:
    cnt+=1

if cnt==0:
  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 and x % 3 != 0 and x % 5 != 0:
    print('DENIED')
print('APPROVED')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

text = 'APPROVED'
for count in A:
    if(count % 2 == 0):
        if(not(count % 3 == 0 or count % 5 == 0)):
            text = 'DENYED'
            break

print(text)

Submission status: Wrong Answer

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

text = 'APPROVED'
for count in range(n):
    if(A[count] % 2 == 0):
        if(count % 3 != 0 and count % 5 != 0):
            text = 'DENYED'
            break

print(text)

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 and (A[i]%3==0 or A[i]%5==0):
    print('APPROVED')
  else:
    print('DENIED')
    break
  break

Submission status: Wrong Answer

Solution code:
N = input()
numList = input().split(' ')
print(numList)
for num in numList:
  num = int(num)
  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: Wrong Answer

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

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