n = list(map(int,input().split()))
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'
      break

print(ans) n = list(map(int,input().split())) n list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split 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 a:
  if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      ans = 'DENIED'
      break i a if i % 2 == 0:
    if i % 3 != 0 and i % 5 != 0:
      ans = 'DENIED'
      break i % 2 == 0 i % 2 i 2 0 if i % 3 != 0 and i % 5 != 0:
      ans = 'DENIED'
      break i % 3 != 0 and i % 5 != 0 i % 3 != 0 i % 3 i 3 0 i % 5 != 0 i % 5 i 5 0 ans = 'DENIED' ans 'DENIED' break print(ans) print ans ans = 'APPROVED' 'APPROVED' ans n = list(map(int,input().split())) list(map(int,input().split())) n ans = 'DENIED' 'DENIED' ans a = list(map(int,input().split())) list(map(int,input().split())) a
n = list(map(int,input().split()))
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'
      break

print(ans)