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
  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


