judge :: [Int] -> Bool
judge ns = and $ map (\n -> n`mod`3 == 0 || n`mod`5 == 0) $ filter even ns

main = do
    getLine
    as <- (map read).words <$> getLine
    if judge as then putStrLn "APPROVED" else putStrLn "DENIED"