main::IO()
main = do
    _ <- getLine
    n <- map read . words <$> getLine
    putStrLn $ if check n then "APPROVED" else "DENIED"
    
check (x:xs) = if even x 
                 then if ((x `mod` 3 == 0) || (x `mod` 5 ==0))
                         then check xs
                         else False
                 else check xs
check [] = True