{
echo APPROVED;
for n in $(cat - | tail -n1); do
        if [ $((${n} - $((${n} / 2)) * 2)) -eq 0 ] ; then
                #echo gu
                if [ $(($((${n} - $((${n} / 3)) * 3)) * $((${n} - $((${n} / 5)) * 5)))) -eq 0 ] ; then
                        echo APPROVED
                else
                        echo DENIED
                fi
        fi
done
} | sort | tail -n1