import std;

void calc(int n, int m) {
    int[][] xs;
    int ma = 0;
    foreach (i; 1..m+1) {
        int a = i;
        int b = i + (m - i) * 2 + 1;
        xs ~= [a, b];

        ma = max(a, b);
    }

    int k = (n - ma) / 2;
    foreach (e; xs) {
        writeln(e[0] + k, " ", e[1] + k);
    }
}

void main() {
    int n, m; scan(n, m);
    calc(n, m);
}

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;
