import std;

// dfmt off
T lread(T = long)(){return readln.chomp.to!T();}
T[] lreads(T = long)(long n){return generate(()=>readln.chomp.to!T()).take(n).array();}
T[] aryread(T = long)(){return readln.split.to!(T[])();}
void scan(TList...)(ref TList Args){auto line = readln.split();
foreach (i, T; TList){T val = line[i].to!(T);Args[i] = val;}}
alias sread = () => readln.chomp();enum MOD = 10 ^^ 9 + 7;
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);
// dfmt on

void main()
{
    long N, M;
    scan(N, M);
    auto used = new bool[](2 * N);
    auto used2 = new bool[](2 * N);
    long l = N - 1;
    long cnt;
    foreach (_; 0 .. N)
    {
        inn: foreach (r; 0 .. l)
        {
            if (used2[r])
            {
                continue;
            }
            long d1 = max(l, r) - min(l, r);
            long d2 = N + min(l, r) - max(l, r);
            // writeln(l, " ", d1, " ", d2);
            l--;
            if (used[d1] || used[d2])
            {
                continue;
            }
            cnt++;
            used[d1] = used[d2] = true;
            used2[l] = used2[r] = true;
            writeln(l + 2, " ", r + 1);
            if (cnt == M)
                return;
            break inn;
        }
    }
}
