# https://atcoder.jp/contests/abc155/tasks/abc155_b

read n ; read row ; A=($row)
for istr in A ; do
  i=$((istr))
  if [ $((i % 2)) -eq $((0)) -a $((i%3)) -ne $((0)) -a $((i%5)) -ne $((0)) ] ; then
    echo "DENIED"
    exit 0
  fi
done
echo "APPROVED"

