#!/bin/bash

read hm
read input
arr=($(echo $input | tr ' ' "\n"))
declare -a evens

hm=$((hm-1))
step=0
while [[ $step -le $hm ]]; do
    mod=$((${arr[step]}%2))
    if [[ mod -eq 0 ]]; then
        evens+=${arr[step]}
    fi
    step=$((step+1))
done
for j in "${!evens[@]}"; do
    res3=$((${evens[j]}%3))
    res5=$((${evens[j]}%5))
    if [[ $res5 -ne 0 ]] || [[ $res5 -ne 0 ]]; then
        echo DENIED
        exit
    fi
done
echo APPROVED
