#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int N, M;

int main() {
	cin >> N >> M;
	int cx = M + 1, cnts = 0;
	for (int i = M; i >= 1; i--) {
		if (N % 2 == 0 && (cx - i) * 2 >= N && cnts == 0) { cx++; cnts = 1; }
		cout << i << " " << cx << endl;
		cx++;
	}
	return 0;
}
#pragma target("avx")
#pragma optimize("O3")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using PP = std::pair<ll,P>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>>;

#define REP(i,b,e) for(ll i=b; i<e; i++)
#define ALL(vec) vec.begin(),vec.end()
#define PRINT(vec) printf("[ ");for(auto &i:vec)printf("%ld ",i);puts("]");
#define SCAN(vec) for(auto &i:vec)scanf("%ld",&i)
#define fi first
#define se second

const int MOD = 1e9+7;
const ll INF = 1e18;
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

int main(){
	int n, m;
	scanf("%d %d", &n, &m);
	if((n-2*m)%2){
	    REP(i, 0, m) printf("%ld %ld\n", i+1, n-i);
	} else {
	    REP(i, 0, (m+1)/2){
		printf("%ld %ld\n", i+1, n-i);
	    }
	    REP(i, (m+1)/2, m){
		printf("%ld %ld\n", i+2, n-i);
	    }
	}
	return 0;
}

