import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import qualified Data.List as L

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words

getInt = fst . fromJust . BS.readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
  n <- getInt
  a <- getIntList
  putStrLn $ solve a

solve :: [Int] -> String
solve a = do
  let s = filter (\n -> n `mod` 2 == 0) a
      b = filter (\n -> n `mod` 3 /= 0) (filter (\n -> n `mod` 5 /= 0) s)
      n = length b
      in if n == 0 then "APPROVED" else "DENIED"