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

ans = 'APPROVED'

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

print(ans) N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = 'APPROVED' ans 'APPROVED' for i in range(N):
  if A[i] % 2 == 0 and A[i] % 6 != 0 and A[i] % 10 != 0:
    ans = 'DENIED'
    break i range(N) range N if A[i] % 2 == 0 and A[i] % 6 != 0 and A[i] % 10 != 0:
    ans = 'DENIED'
    break A[i] % 2 == 0 and A[i] % 6 != 0 and A[i] % 10 != 0 A[i] % 2 == 0 and A[i] % 6 != 0 A[i] % 2 == 0 A[i] % 2 A[i] A i 2 0 A[i] % 6 != 0 A[i] % 6 A[i] A i 6 0 A[i] % 10 != 0 A[i] % 10 A[i] A i 10 0 ans = 'DENIED' ans 'DENIED' break print(ans) print ans A = list(map(int, input().split())) list(map(int, input().split())) A N = int(input()) int(input()) N ans = 'APPROVED' 'APPROVED' ans ans = 'DENIED' 'DENIED' ans
N = int(input())
A = list(map(int, input().split()))

ans = 'APPROVED'

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

print(ans)