main :: IO ()
main = do
  [n, m] <- map read . words <$> getLine
  let as = if odd n
             then [[i, n - i] | i <- [1 .. n `div` 2]]
             else let n' = n `div` 2
                      n'' = (n' + 1) `div` 2
                  in [[i, n - i] | i <- [1 .. n'' - 1]] ++ [[i, n + 1 - i] | i <- [n'' + 1 .. n']]
  putStr $ unlines $ map (unwords . map show) $ take m as