main :: IO ()
main = do
  args <- fmap (map (map toInt . words) . lines) getContents
  presentation args

presentation :: [[Int]] -> IO ()
presentation [[a, b], [0, 0]] = mapM_ print $ solve a b
presentation ([a, b]:t) = do
  case res of
    [] -> putStrLn "NA"
    otherwise -> mapM_ print res
  putStrLn ""
  presentation t
  where
    res = solve a b
presentation _ = return ()

toInt :: String -> Int
toInt = read

upperbound :: Int -> Int
upperbound n = ((n + 3) `div` 4) * 4

lowerbound :: Int -> Int
lowerbound n = (n `div` 4) * 4

solve :: Int -> Int -> [Int]
solve from to = [x | x <- [upperbound from, upperbound from + 4 .. lowerbound to], (x `mod` 16) == 0 || (x `mod` 25) /= 0 ]