f :: Int -> Bool
f n
	| odd n          = True
	| n `mod` 3 == 0 = True
	| n `mod` 5 == 0 = True
	| otherwise      = False

main = do
	n <- getLine
	lista <- (map read . words) <$> getLine
	if and $ map f lista
		then putStrLn "APPROVED"
		else putStrLn "DENIED"