import scala.io.StdIn

object Main extends App {

  val (n, m) = readIntPair
  var l = 1
  var r = n - 1
  var s = 1
  for (i <- 0 until m) {
    println(s"${s} ${(s + i)%n+1}")
    s += i + 2
  }

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

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