import java.util.*
import java.math.*
import kotlin.math.*

fun readLn()=readLine()!!
fun readInt()=readLn().toInt()
fun readInts()=readLn().split(" ").map{it.toInt()}
fun readLong()=readLn().toLong()
fun readLongs()=readLn().split(" ").map{it.toLong()}

val out=mutableListOf<String>()
fun printLine(s:String){out.add(s)}
fun output(){println(out.joinToString("\n"))}

fun main(){
    var (n,m)=readInts()
    var k=(m+1)/2
    if(n%2==1){
        k=m
    }
    var l=k;var r=k+1
    for(i in 1..k){
        printLine("$l $r")
        l--;r++
    }
    l=k*2+m-k;r=l+2
    for(i in 1..m-k){
        printLine("$l $r")
        l--;r++
    }
    output()
}