def main():

    N, M = list(map(int, input().split()))



    # i = 0

    # cnt = 0

    # while cnt < M:

    #     if (N - i * 2 - 1) * 2 != N:

    #         print(1 + i, N - i)

    #         cnt += 1

    #     i += 1







    i = 0

    j = 0

    cnt = 0

    d = set()

    ans = []

    while cnt < M:

        d1 = N - i * 2 - j - 1

        d2 = N - d1

        if d1 in d or d2 in d or d1 * 2 == N or d2 * 2 == N:

            j += 1

            continue

        ans.append((1 + i + j, N - i))

        d.add(d1)

        d.add(d2)

        cnt += 1

        i += 1



    for row in ans:

        print((*row))



if __name__ == '__main__':

    main()

def main():

    N, M = list(map(int, input().split()))



    pairs = []

    a = 1

    for d in range(M, 0, -2):

        pairs.append((a, a + d))

        a += 1



    a = 1 + M + 1

    for d in range(M - 1, 0, -2):

        pairs.append((a, a + d))

        a += 1



    for pair in pairs:

        print((*pair))





if __name__ == '__main__':

    main()

def main():
    N, M = list(map(int, input().split()))
    # i = 0
    # cnt = 0
    # while cnt < M:
    #     if (N - i * 2 - 1) * 2 != N:
    #         print(1 + i, N - i)
    #         cnt += 1
    #     i += 1
    i = 0
    j = 0
    cnt = 0
    d = set()
    ans = []
    while cnt < M:
        d1 = N - i * 2 - j - 1
        d2 = N - d1
        if d1 in d or d2 in d or d1 * 2 == N or d2 * 2 == N:
            j += 1
            continue
        ans.append((1 + i + j, N - i))
        d.add(d1)
        d.add(d2)
        cnt += 1
        i += 1
    for row in ans:
        print((*row))


if __name__ == "__main__":
    main()

def main():
    N, M = list(map(int, input().split()))
    pairs = []
    a = 1
    for d in range(M, 0, -2):
        pairs.append((a, a + d))
        a += 1
    a = 1 + M + 1
    for d in range(M - 1, 0, -2):
        pairs.append((a, a + d))
        a += 1
    for pair in pairs:
        print((*pair))


if __name__ == "__main__":
    main()

-    # i = 0 -    # cnt = 0 -    # while cnt < M: -    #     if (N - i * 2 - 1) * 2 != N: -    #         print(1 + i, N - i) -    #         cnt += 1 -    #     i += 1 -    i = 0 -    j = 0 -    cnt = 0 -    d = set() -    ans = [] -    while cnt < M: -        d1 = N - i * 2 - j - 1 -        d2 = N - d1 -        if d1 in d or d2 in d or d1 * 2 == N or d2 * 2 == N: -            j += 1 -            continue -        ans.append((1 + i + j, N - i)) -        d.add(d1) -        d.add(d2) -        cnt += 1 -        i += 1 -    for row in ans: -        print((*row)) +    pairs = [] +    a = 1 +    for d in range(M, 0, -2): +        pairs.append((a, a + d)) +        a += 1 +    a = 1 + M + 1 +    for d in range(M - 1, 0, -2): +        pairs.append((a, a + d)) +        a += 1 +    for pair in pairs: +        print((*pair))