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

int main()
{
	int n, m; scanf("%d%d", &n, &m);
	for (int i = 1; i <= m; ++i) 
		if (2 * i < m + 2) printf("%d %d\n", i, m + 2 - i);
	for (int i = 1; i <= m; ++i) 
		if (2 * i < m + 1) printf("%d %d\n", m + 1 + i, 2 * m + 2 - i);
	return 0;
}

#include <bits/stdc++.h>
#define int long long
typedef long long ll;
using namespace std;

const ll MAXN = 200000;
const ll INF = 1001001001;
const ll MOD = 1000000007;

ll N, M, tmp=0;
vector<pair<ll,ll>> ans;

signed main(){
    cin >> N >> M;
    for(int i=1;i<=M;i++) {
        tmp = 0;
        if(N%2==0&&4*i>=N) tmp++;
        cout << (N-i-tmp)%N << " " << (N+i)%N << endl;
    }
    return 0;
}