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 l = 1;
    auto bs = new bool[](N*2);
    bs[1] = true;
    bs[2] = true;
    foreach (h; 1..M+1) {
        auto r = l+h;
        bs[r] = true;
        writeln(l, " ", r);
        while (bs[l]) ++l;
        bs[l] = true;
    }
}