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.

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

























def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')

def main():
	N = inputInt()
	A = inputList()

	flg = False

	for i in A:
		if i % 2 == 0:
			if i % 3 == 0 or i % 5 == 0:
				pass
			else:
				flg = True

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

if __name__ == "__main__":
	main()

Solution (Python):
N = int(input())

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

ans = 'APPROVED'

for i in range(N):
    if A[i] % 2 != 0:
        continue
    else:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            continue
        else:
            ans = 'DENIED'

print(ans)

Solution (Python):
n = int(input())
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 = "APPROVED"
        else:
            ans = "DENIED"
            break

print(ans)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
b = len([x for x in a if x % 2 == 0 and x % 3 > 0 and x % 5 > 0])
if b == 0:
    print('APPROVED')
else:
    print('DENIED')

Solution (Python):
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
else:
    print("APPROVED")

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

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

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

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

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

print(ans)

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

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

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

for i in range(n):
    if l[i]/2==l[i]//2:
        if l[i]/3!=l[i]//3 and l[i]/5!=l[i]//5:
            print("DENIED")
            break

    if i==n-1:
        print("APPROVED")

Solution (Python):
def main():
    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:
                pass
            else:
                flag = False

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys
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")
            sys.exit()

print("APPROVED")

Solution (Python):
import sys

n = int(input())
arr = map(int, input().split())

for a in arr:
    if a % 2 == 0:
        if a % 3 == 0:
            continue
        elif a % 5 == 0:
            continue
        else:
            print('DENIED')
            sys.exit()
else:
    print('APPROVED')

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

flag = True
for i in range(n):
    if(not a[i]%2 == 1 and not a[i]%3 == 0 and not a[i]%5 == 0):
        flag = False

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

Solution (Python):
N = int(input())

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

Solution (Python):


import sys
import math

from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint

INF = float('inf')

ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
sys.setrecursionlimit(1000000000)


def lcm(a, b):
    return (a * b) // gcd(a, b)



n = ii()
a = mis()

for aa in a:
    if aa%2==0:
        if aa%3==0 or aa%5==0:
            pass
        else:
            print('DENIED')
            exit(0)

print('APPROVED')

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

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

Solution (Python):
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


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

if __name__ == '__main__':
    main()

Solution (Python):
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 and a[i] % 5 != 0:
            c = 1
if c == 0:
    print("APPROVED")
else:
    print("DENIED")

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

approved = True
for Ai in A:
    if Ai % 2 == 0:
        if Ai % 3 != 0 and Ai % 5 != 0:
            approved = False
            break
print('APPROVED' if approved else 'DENIED')

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

ans = True

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

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

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

flag=True
for i in a:
    if i % 2==0:
        if i%3 !=0 and i%5!=0:
            flag=False
            break

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

Solution (Python):
n=int(input())
l=map(int,input().split())
flag=1

for i in l:
  if i%2==0:
    if i%3==0 or i%5==0:
      flag*=1
    else:
      flag*=0

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

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

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

Solution (Python):
import sys

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 A[i] % 5 != 0:
        print("DENIED")
        sys.exit()
print("APPROVED")

Solution (Python):
N = int(input())
As = list(map(int, input().split()))

approved = True
for i in range(N):
    if As[i] % 2 == 0:
        if As[i] % 3 != 0 and As[i] % 5 != 0:
            approved = False
            break
if approved:
    print("APPROVED")
else:
    print("DENIED")

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

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

Solution (Python):
n=int(input())
alist=list(map(int,input().split()))
check=True
for a in alist:
  if a%2==0:
    if a%3!=0 and a%5!=0:
      check=False
if check:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
N = int(input())

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

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

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

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

for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            N -= 1
    else:
        N -= 1

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

Solution (Python):
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")
            exit()

print("APPROVED")

Solution (Python):
N = int(input())
A = [int(a) for a in input().split()]
ans = 'APPROVED'
for a in A:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            ans = 'DENIED'
            break
print(ans)

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

Solution (Python):

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

flag = True
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            flag = False
if flag:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
for i in A:
    if i % 2 == 0:
        if not(i % 3 == 0 or i % 5 ==0):
            print ('DENIED')
            exit (0)
print ('APPROVED')

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

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

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

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

Solution (Python):
def A():
    A, B, C = map(int, input().split())
    if A == B or B == C or A == C:
        if (A+B+C) != A*3:
            print('YES')
            return
    print('NO')

def B():
    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 i%5==0):
            print('DENIED')
            return
    print('APPROVED')
B()

Solution (Python):
import sys

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

for m in mylist:
    if m%2 == 0:
      if m%3 == 0:
          continue
      elif m%5 == 0:
          continue
      else:
          print('DENIED')
          sys.exit()
print('APPROVED')

Solution (Python):
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:
      pass
    else:
      flag = False
if flag:
  print("APPROVED")
else:
  print("DENIED")

Solution (Python):
import sys

def main():
    N = int(input())
    X = list(map(int, input().split()))

    for x in X:
        if x % 2 == 1:
            continue

        if x % 3 != 0 and x % 5 != 0:
            print('DENIED')
            return

    print('APPROVED')
    return


if __name__ == '__main__':
    main()

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

ans = 'DENIED'
for Ai in A:
    if Ai % 2 > 0: continue
    
    if Ai % 3 > 0 and Ai % 5 > 0: break
    else: continue
else:
    ans = 'APPROVED'

print(ans)

Solution (Python):

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

print('DENIED')

Solution (Python):
n = int(input())
arr = list(map(int, input().split()))
c, v = 0, 0
for i in arr:
  if i % 2 == 0:
    c += 1
    if i % 3 == 0 or i % 5 == 0:
      v += 1
print('APPROVED' if c == v else 'DENIED')

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
flag = True
for x in a:
    if x % 2==0:
        if x % 3 == 0 or x % 5 == 0:
            pass
        else:
            flag = False
            break
print("APPROVED" if flag else "DENIED")

Solution (Python):
n=int(input())
List=list(map(int, input().split()))
for i in range(n):
    if(List[i]%2==0):
        if(List[i]%3==0):
            continue;
        elif(List[i]%5==0):
            continue;
        print("DENIED")
        exit(0)
print("APPROVED")

Solution (Python):
import sys





import time


mod = int(1e9+7)
INF = 1<<29

def main():
    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")
                return
    print("APPROVED")
    return

if __name__=='__main__':
    main()

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

B=[]
for i in A:
    if i%2==0:
        if i%3!=0 and i%5!=0:
            print("DENIED")
            exit()
print("APPROVED")

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

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

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

gu = [l for l in lst if l%2==0]

flag = True
for g in gu:
    if (g%3 == 0) or (g%5 == 0):
        continue
    else:
        flag = False

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

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
e, c = 0, 0
for i in range(n):
    if l[i] % 2 == 0:
        if l[i] % 3 == 0 or l[i] % 5 == 0:
            c += 1
        else:
            print("DENIED")
            exit()
        e += 1
if e == c:
    print("APPROVED")

Solution (Python):
n = int(input())
l = [int(i) for i in input().split()]
  
f = True
for i in l:
  if i % 2 == 0:
    if not (i % 3 == 0 or i % 5 ==0):
      f = False
      break
      
if f:
  print('APPROVED')
else:
  print('DENIED')

Solution (Python):
N = int(raw_input())
A = map(int, raw_input().split())

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

print ans

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

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

print("APPROVED" if count == N else "DENIED")

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

app_flag = True
for i in A:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            pass
        else:
            app_flag = False

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

Solution (Python):
import math
import itertools



N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    if A[i]%2==0:
        if not(A[i]%3==0 or A[i]%5==0):
            print("DENIED")
            exit()

print("APPROVED")

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

Solution (Python):
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines






def main():
	n=int(input())
	A=list(map(int,input().split()))
	
	ans="APPROVED"
	
	
	for i in range(n):
		if A[i]%2==0:
			if A[i]%3!=0 and A[i]%5!=0:
				ans="DENIED"
	
	print(ans)
	
	
	
	
	
	
	
	




	
if __name__ == "__main__":
	main()

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]

jdg = False
for i in a:
    if (i % 2 == 0 and (i % 5 != 0 and i % 3 != 0)):
        jdg = True
        break

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

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

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

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

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

print(ans)

Solution (Python):
import sys
import math
import bisect

def solve(A):
    for a in A:
        if a % 2 == 0:
            if a % 3 != 0 and a % 5 != 0:
                return False
    return True

def main():
    n = int(input())
    A = list(map(int, input().split()))
    if solve(A):
        print('APPROVED')
    else:
        print('DENIED')

if __name__ == "__main__":
    main()

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

res = 'APPROVED'
for a in A:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            res = 'DENIED'

print(res)

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

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

Solution (Python):
import sys
N = int(input())
A = list(map(int,input().split()))

for i in range(len(A)):
	if A[i] % 2 == 0:
		
		if A[i] % 3 == 0 or A[i] % 5 == 0:
			pass
		else:
			print('DENIED')
			sys.exit()

print('APPROVED')

Solution (Python):
n,*a,=map(int,open(0).read().split())
print("DENIED" if sum([(i%3)*(i%5) for i in a if i%2==0]) else "APPROVED")

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

Solution (Python):
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')
      exit()
print('APPROVED')

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]

if all([i % 2 == 1 or i % 3 == 0 or i % 5 == 0 for i in A]):
    print('APPROVED')
else:
    print('DENIED')

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

A2 = []
for ai in A:
    if ai % 2 == 0:
        A2.append(ai)

ans = True
for ai in A2:
    if ai % 3 != 0 and ai % 5 != 0:
        ans = False


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

Solution (Python):

def solution():
    n = int(input().strip())
    a  = [int(x) for x in input().strip().split(" ")]
    for x in a:
        if x % 2 == 0:
            if x % 3 != 0 and x % 5 != 0:
                print("DENIED")
                return
    print("APPROVED")

def main():    
    
    for _ in range(1):
        solution()
    

main()

Solution (Python):
N = int(input())
A = [int(x) for x in input().split()]
flag = True
for i in range(len(A)):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            continue
        else:
            flag = False
            break
if flag == True:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
import sys

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

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

Solution (Python):
n = int(input())
aa = [int(x) for x in input().split()]
def ok(x):
    return x % 2 == 1 or (x % 3 == 0 or x % 5 == 0)
if all(ok(x) for x in aa):
    print('APPROVED')
else:
    print('DENIED')

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

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

ans = "APPROVED"
for v in a:
    if v%2==0:
        if v%3!=0 and v%5!=0:
            ans = "DENIED"
            
print(ans)

Solution (Python):

n = int(input())

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

Solution (Python):
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')
            exit()
print('APPROVED')

Solution (Python):
import sys
input = sys.stdin.readline


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

cnt = 0
for i in a:
    if i % 2 == 0:
        if (i % 3 == 0) | (i % 5 == 0):
            pass
        else:
            cnt = 1

if cnt == 1:
    print('DENIED')
else:
    print('APPROVED')

Solution (Python):
import sys
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:
            pass
        else:
            print("DENIED")
            sys.exit()
print("APPROVED")

Solution (Python):

def solve():
    input()
    for i in map(int, input().split()):
        if i%2:
            pass
        else:
            if i%3 and i%5:
                return 'DENIED'
    return 'APPROVED'    
if __name__ == '__main__':
    print(solve())

Solution (Python):
n = int(input())
L = list(map(int,input().split()))
flag = True
for i in range(n):
  cnt = 0
  if L[i]%2 == 0:
    if L[i]%3 == 0:
      cnt += 1
    elif L[i]%5 == 0:
      cnt += 1
    if cnt == 0:
      flag = False
      break
if flag:
  print('APPROVED')
else:
  print('DENIED')

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

Solution (Python):
N = input()
A = list(map(int,input().split()))
flag = 0

for i in A:
    if i%2 == 0 and (i%3 !=0 and i%5 !=0):
        flag = 1

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

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

count=0
for i in m:
    if (i%2==0):
        if (i%3!=0) and (i%5!=0): 
            count+=1
if count==0:
    print("APPROVED")
else:
    print("DENIED")

Solution (Python):
N = int(input())
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")

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

for i in range(len(A)):
    if A[i]%2 == 0 and A[i]%3 > 0 and A[i]%5 > 0:
        print("DENIED")
        exit()

print("APPROVED")

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

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

r = True

for i in a:
    if i % 2 == 0 and (i % 3 != 0 and i % 5 != 0):
        r = False

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

Solution (Python):
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n = i()
a = intl()
cnt1 = 0
cnt2 = 0
for i in range(n):
    if a[i]%2 == 0:
        cnt1 += 1
        if a[i]%3 == 0 or a[i]%5 == 0:
            cnt2 += 1
print("APPROVED" if cnt1 == cnt2 else "DENIED")

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

Solution (Python):
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

def main():
    n = int(input().strip())
    v = list(map(int, input().strip().split()))
    for c in v:
        if c % 2 == 0:
            if not (c % 3 == 0 or c % 5 == 0):
                print('DENIED')
                return
    print('APPROVED')
if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
is_approved = True
for a_str in input().split():
    a = int(a_str)
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            is_approved = False
            break

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

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

l=[]
for i in a:
    if i%2==0:
        l.append(i%3==0 or i%5==0)
print("APPROVED" if all(l) else "DENIED")

Solution (Python):
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:
            pass
        else:
            print("DENIED")
            exit()

print("APPROVED")

Solution (Python):
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')
      exit()
print('APPROVED')

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
even = [a for a in A if a % 2 == 0]
ok = True
for e in even:
    if e % 3 != 0 and e % 5 != 0:
        ok = False
        break
print("APPROVED" if ok else "DENIED")

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

f = True
for a in A:
    if a%2==0 and a%3!=0 and a%5!=0:
        f=False
        break

print('APPROVED' if f else 'DENIED')

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

Solution (Python):
N=int(input())
A = [int(i) for i in input().split()]

for ia in A:
    if ia%2==0:
        if ia%3==0 or ia%5==0:
            pass
        else:
            print("DENIED")
            exit()


print("APPROVED")

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

for i in range(N):
  a=A[i]
  if a%2==0:
    if a%3!=0 and a%5!=0:
      print("DENIED");exit()
print("APPROVED")

Solution (Python):


from sys import stdin, stderr

def main():
   N = int(stdin.readline())
   A = map(int, stdin.readline().split())

   for x in A:
      if (x % 2) == 0:
         if (x % 3) != 0 and (x % 5) != 0:
            print('DENIED')
            return 0
   print('APPROVED')

   return 0

if __name__ == '__main__': main()

Solution (Python):
N = int(input())

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

res = "APPROVED"

for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            continue
        else:
            res = "DENIED"
            break

print(res)

Solution (Python):
n=int(input())
a=[int(i) for i in input().split()]
ans=[i for i in a if (i%2==0 and i%3 and i%5)]
print("DENIED" if len(ans) else "APPROVED")

Solution (Python):
def main():
    n = int(input().strip())
    A = [int(s) for s in input().strip().split()]
    if all(a % 2 == 1 or a % 3 == 0 or a % 5 == 0 for a in A):
        print("APPROVED")
    else:
        print("DENIED")


main()

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
ans = "APPROVED"
for a in A:
    if a % 2 == 0:
        if a % 5 == 0 or a % 3 == 0:
            continue
        ans = "DENIED"
print(ans)

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

Solution (Python):
N = int(input())
A_list= list(input().split())

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

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N, *A = map(int, read().split())

ans = True
for a in A:
    if a % 2 == 0:
        if (a % 3 == 0) or (a % 5 == 0):
            pass
        else:
            ans = False

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

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

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]

flag = True

for i in range(N):
    if A[i] % 2 == 0 and (A[i] % 3 != 0 and A[i] % 5 != 0):
        flag = False
        
if flag:
    print("APPROVED")
else:
    print("DENIED")

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

flag = True

for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3!=0 and a[i]%5!=0:
            flag = False
            break

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