local min=math.min
N=io.read"*n"
M=io.read"*n"

if(N%2==1)then
	for i=1,M do
		print(i,N-i)
	end
else
	if(N%4==2)then
		a=(N-2)/4
		for i=1,min(a,M) do
			print(i,a+a+2-i)
		end
		if(M<=a)then return end
		M=M-a
		for i=1,min(a,M) do
			print(a+a+1+i,a*4+2-i)
		end
	else
		a=N/4
		for i=1,min(a-1,M) do
			print(i,a+a-i)
		end
		if(M<=a-1)then return end
		M=M-a+1
		for i=1,min(a,M) do
			print(a+a-1+i,a*4-i)
		end
	end
end