#include <bits/stdc++.h>

using namespace std;


#ifdef zxc

#include <sys/resource.h>
#include "debug.h"

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

using ll = int64_t;
using ld = double;
const ld EPS = 1e-9;
//const ll MOD = 924844033;
const ld PI = 3.141592653589793;
const int maxn = 300001;

void fast_io() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}

signed main() {
#ifdef zxc
    struct rlimit rl;
    const rlim_t kStackSize = 512L * 1024L * 1024L;
    assert(!getrlimit(RLIMIT_STACK, &rl));
    rl.rlim_cur = kStackSize;
    assert(!setrlimit(RLIMIT_STACK, &rl));
    freopen("../kolya_input.txt", "r", stdin);
//    freopen("../kolya_output.txt", "w", stdout);
#else
    //    mt19937 mt(std::chrono::high_resolution_clock::now().time_since_epoch().count());
    //            freopen("", "r", stdin);
    //        freopen("hack.out", "w", stdout);
#endif
    fast_io();
    cout.precision(6);
    cout << fixed;
    auto start = chrono::steady_clock::now();
    int n, m;
    cin >> n >> m;
//    for (int n = 1; n <= 10000; ++n) {
//        for (int m = 1; 2 * m + 1 <= n; ++m) {
            set<int> ost;
            set<int> pos;
            if (n & 1) {
                int a = 1;
                int b = n;
                for (int i = 1; i <= m; ++i, ++a, --b) {
                    cout << a << " " << b << "\n";
                    assert(!pos.count(a));
                    pos.insert(a);
                    assert(!pos.count(b));
                    pos.insert(b);
                    int x = (b - a + n) % n;
                    int u = (a - b + n) % n;
                    debug(x, u);
                    assert(!ost.count(x));
                    ost.insert(x);
                    assert(!ost.count(u));
                    ost.insert(u);
                }
            } else {
                vector <pair<int, int>> ans;
                int mx = (n - 1) / 2;
                int start = 1;
                for (int i = mx; i >= 1; --i) {
                    if (i & 1) {
                        ans.emplace_back(start, start + i);
                        ++start;
                    }

                }
                start = n;
                for (int i = mx; i >= 1; --i) {
                    if (i % 2 == 0) {
                        ans.emplace_back(start - i, start);
                        --start;
                    }
                }
                for (int e = 0; e < m; ++e) {
                    cout << ans[e].first << " " << ans[e].second << "\n";
                    auto[a, b] = ans[e];
                    assert(!pos.count(a));
                    pos.insert(a);
                    assert(!pos.count(b));
                    pos.insert(b);
                    int x = (b - a + n) % n;
                    int u = (a - b + n) % n;
                    debug(x, u);
                    assert(!ost.count(x));
                    ost.insert(x);
                    assert(!ost.count(u));
                    ost.insert(u);
                }
            }
//        }
//    }

    auto end = chrono::steady_clock::now();

    debug("time", chrono::duration_cast<chrono::milliseconds>(end - start).count() / 1000.0);

}



Measured memory_bytes: 20460