function main(input) {
  const inputs =input.split('\n')
  const [N] = inputs[0].split(' ').map(Number)
  const A = inputs[1].split(' ').map(Number)

  console.log(
    A.reduce((h, e) => {
      return h && (e % 2 == 0 ? e % 3 === 0 || e % 5 === 0 : true)
    }, true) ? 'APPROVED' : 'DENIED'
  )
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
