main = do
  n <- readLn :: IO Int
  as <- map read . words <$> getLine :: IO [Int]
  putStrLn $ if check as then "APPROVED" else "DENIED"

check as = foldl (&&) True $ map checkItem as
    where checkItem a | odd a = True
                      | otherwise = mod a 3 == 0 || mod a 5 == 0
