import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto nm = readln.split.to!(int[]);
    auto N = nm[0];
    auto M = nm[1];

    int[] as, bs;
    int t = 1, cnt;
    foreach_reverse (i; 1..M+1) if (i%2 == 1) {
        as ~= t++;
        ++cnt;
    }
    t += cnt-1;
    foreach (i; 1..M+1) if (i%2 == 1) {
        bs ~= t--;
    }
    t += cnt+1;
    cnt = 0;
    foreach_reverse (i; 1..M+1) if (i%2 == 0) {
        as ~= t++;
        ++cnt;
    }
    t += cnt;
    foreach (i; 1..M+1) if (i%2 == 0) {
        bs ~= t--;
    }
    foreach (i, a; as) {
        auto b = bs[i];
        writeln(a, " ", b);
    }
}