solve [] = "APPROVED"
solve (x:xs)
  | odd x = solve xs
  | cond = solve xs
  | otherwise = "DENIED"
  where
    cond = (x `mod` 3 == 0) || (x `mod` 5 == 0)

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