#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, m;
    cin >> n >> m;
    int l1 = 1, r1 = m+1, l2 = m+2, r2 = 2*m+1;
    auto put = [](int &a, int &b) {
        cout << a << " " << b << endl;
        a++; b--;
    };
    rep(i, m) {
        if (l1 < r1) put(l1, r1);
        else put(l2, r2);
    } 
}
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

template <typename TYPE>
void print_vec(const vector<TYPE>& v){
	for(int i=0; i<v.size(); i++){
		cout << v[i] << " ";
	}
	cout << endl;
}

template <typename TYPE>
void print_vec2(const vector<vector<TYPE>>& v){
  cout << endl; cout << "       ";
  for(int i=0; i<v[0].size(); i++) cout << i << "   "; 
  cout << endl;
	for(int i=0; i<v.size(); i++){
		cout << "i=" << i << ":   ";
		for(int j=0; j<v[i].size(); j++){
			if(v[i][j] == 0) cout << "\x1B[0m" << v[i][j] << "   ";
      else cout << "\x1B[31m" << v[i][j] << "   ";//https://stackoverrun.com/ja/q/12618775
		}
		cout << "\x1B[0m" << endl;
	}
}
 

int main(){
	int N, M;
	cin >> N >> M;

	if(N % 2 == 1){
		for(int i=1; i<=M; i++){
			cout << i << " " << N-i+1 << endl;
		}
		return 0;
	}

	//以下Nが偶数の場合 
	//b-a==N/2にならないように途中で1ずらして表示　例(N, M) = (6,2)で影響
	//あるいは 前回のa,bの差と 今回のa,bの差の合計がNにならないように途中で1ずらして表示 例(N, M) = (8, 3)で影響
	int tmp = 0;
	for(int i=1; i<=M; i++){
		if(tmp==0 &&  (N-i+1)-(i) == N/2) tmp++;
		if(tmp==0 && (N-i+2)-(i-1) + (N-i+1)-i == N) tmp++;
		cout << i << " " << N-i+1-tmp << endl;
	}
	return 0;
}
