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

read n ; read row ; A=($row)
ok="0"
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"
    ok=1
    break
  fi
done

if [ $ok = 0 ] ; then
  echo "APPROVED"
fi


