#include<bits/stdc++.h>
using namespace std;

int main(){
	int N,M;
	cin >> N >> M;
	int loop;
	int minN = 2*M+1;
	for(loop=1;loop<M+1-loop;loop++){
		cout << loop << " " << M-loop+1 << endl;
	}
	for(loop=1;loop<M+2-loop;loop++){
		cout << M+loop << " " << minN+1-loop << endl;
	}
	return 0;
}