#include <bits/stdc++.h>


using namespace std;

using ll = long long;


int main(void) {
    ll N, M;
    cin >> N >> M;
    ll even_max_len = M % 2 == 0 ? M : M - 1;
    ll odd_max_len = M % 2 == 1 ? M : M - 1;
    for (ll i = M; i > 0; i--) {
        if (i % 2 == 0) {
            ll j = (even_max_len - i) / 2;
            printf("%lld %lld\n", 1 + j, 1 + j + i);
        } else {
            ll base = even_max_len + 2;
            ll j = (odd_max_len - i) / 2;
            printf("%lld %lld\n", base + j, base + j + i);
        }
    }
}

// practice with Dukkha
#include <algorithm>
#include <iostream>

using namespace std;

int main() {
	int n, m; cin >> n >> m;
	for (int i = 1, j = m + 1; i < j; i++, j--)
		cout << i << ' ' << j << '\n';
	for (int i = m + 2, j = m + m + 1; i < j; i++, j--)
		cout << i << ' ' << j << '\n';
	return 0;
}
