solve list = g . f $ filter (\n -> even n) list
  where
    g b = if b then "APPROVED" else "DENIED"
    f list = foldr (\x y -> if (x `mod` 3 == 0) || (x `mod` 5 == 0)
                        then (True &&) y
                        else (False &&) y) True $ list

main = do
  _ <- readLn :: IO Int
  ls <- map read . words <$> getLine :: IO [Int]
  putStrLn $ solve ls