
let rec take n = function
  | [] -> []
  | x :: xs ->
      if n = 0 then []
      else x :: take (n - 1) xs

let () = Scanf.scanf "%d %d" @@ fun n m ->
  let ans = ref [] in
  let i = ref 1 in
  let j = ref (n / 2) in
  while (!i < !j) do
    ans := (!i, !j) :: !ans;
    incr i;
    decr j
  done;
  let i = ref ((n + 1) /2) in
  let j = ref n in
  while (!i < !j) do
    ans := (!i, !j) :: !ans;
    incr i;
    decr j
  done;
  List.iter (fun (i, j) -> Printf.printf "%d %d\n" i j) @@
  take m !ans
