module Main where

import Data.List

main = do
    getLine
    putStrLn =<< solve <$> readInts

readInts :: IO [Int]
readInts = (sort . (map read) . words) <$> getLine

solve :: [Int] -> String
solve [] = "APPROVED"
solve (x:xs)
    | mod x 2 == 1 = solve xs
    | mod x 3 == 0 = solve xs
    | mod x 5 == 0 = solve xs
    | otherwise = "DENIED"

