main = do
    line <- getLine
    line <- getLine
    let p = [read x::Int | x<-words line]
    putStrLn $ if ( and $ map judge p) then "APPROVED" else "DENIED"

judge :: Int -> Bool
judge x
    | mod x 2 == 1 = True
    | otherwise = if (mod x 3 ==0 || mod x 5 ==0) then True else False  