t = input()
a = input().split()
a = [int(i) for i in a]
ans = "APPROVED"
for i in range(len(a)):
  if a[i] % 2 == 0:
    if a[i] % 3 == 0 or a[i] % 5 == 0:
      continue
    else:
      ans = "DENIED"
      break
  else:
    continue
print(ans) t = input() t input() input a = input().split() a input().split() ().split () input split int(i) for i in a for i in a i a for i in a int(i) int i a = [int(i) for i in a] a [int(i) for i in a] ans = "APPROVED" ans "APPROVED" for i in range(len(a)):
  if a[i] % 2 == 0:
    if a[i] % 3 == 0 or a[i] % 5 == 0:
      continue
    else:
      ans = "DENIED"
      break
  else:
    continue i range(len(a)) range len(a) len a if a[i] % 2 == 0:
    if a[i] % 3 == 0 or a[i] % 5 == 0:
      continue
    else:
      ans = "DENIED"
      break
  else:
    continue a[i] % 2 == 0 a[i] % 2 a[i] a i 2 0 if a[i] % 3 == 0 or a[i] % 5 == 0:
      continue
    else:
      ans = "DENIED"
      break
   a[i] % 3 == 0 or a[i] % 5 == 0 a[i] % 3 == 0 a[i] % 3 a[i] a i 3 0 a[i] % 5 == 0 a[i] % 5 a[i] a i 5 0 continue ans = "DENIED" ans "DENIED" break continue print(ans) print ans ans = "APPROVED" "APPROVED" ans t = input() input() t a = [int(i) for i in a] [int(i) for i in a] a a = input().split() input().split() a ans = "DENIED" "DENIED" ans
t = input()
a = input().split()
a = [int(i) for i in a]
ans = "APPROVED"
for i in range(len(a)):
  if a[i] % 2 == 0:
    if a[i] % 3 == 0 or a[i] % 5 == 0:
      continue
    else:
      ans = "DENIED"
      break
  else:
    continue
print(ans)