import Data.List
import Control.Applicative

main = do
  _ <- getLine
  nums <- map read . words <$> getLine :: IO [Int]
  show' [x | x <- nums, f x]
  where
    show' [] = putStrLn "APPROVED"
    show' xs = putStrLn "DENIED"
    f x | x `mod` 2 == 1 = False
        | x `mod` 3 == 0 = False
        | x `mod` 5 == 0 = False
        | otherwise = True
