import scala.collection.mutable
import scala.io.StdIn

object Main extends App {

  val (n, m) = readIntPair
  val (l, r) = (1 to n).splitAt((n-1) / 2)
  val first = if (n % 2 == 1) m else m - 1
  var set = new mutable.TreeSet[Int]()

  var f = 1
  var s = n

  for (i <- 1 to m) {
    while (set.contains(s - f) || s - f == n - s + f) s -= 1
    set += s - f
    set += n - s + f
    assert(f < s)
    println(s"$f $s")
    f += 1
    s -= 1
  }

//  l.reverse.take(first).zip(r).foreach { case (x , y) =>
//    println(s"$x $y")
//  }

//  if (n % 2 == 0)
//    println(s"1 ${n-1}")


  def readIntPair: (Int, Int) = {
    val Array(x, y) = StdIn.readLine().split(" ").map(_.toInt)
    (x, y)
  }

  def readIntArr = StdIn.readLine().split(" ").map(_.toInt)
}

//1 2 3 4 5 6 7 8




