import qualified Data.ByteString.Char8 as B
import           Data.Maybe            (fromJust)

readInts :: B.ByteString -> [Int]
readInts = map (fst . fromJust . B.readInt) . B.words

getInts :: IO [Int]
getInts = readInts <$> B.getLine

main :: IO ()
main = do
  n <- readLn
  as <- getInts
  putStrLn $ if solve n as then "APPROVED" else "DENIED"

solve :: Int -> [Int] -> Bool
solve _ as = all (\x -> x `mod` 3 == 0 || x `mod` 5 == 0) $ filter even as
