main :: IO ()
main = do
  [a, b] <- fmap (map (\n -> read n :: Int)) $ fmap words getLine
  case (a, b) of
    (0, 0)-> return ()
    otherwise -> do
      case res of
        [] -> putStrLn "NA"
        otherwise -> mapM_ print res
      putStrLn ""
      main
      where
        res = solve a b

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 ]