#!/usr/bin/env python3
import sys


def solve(N: int, M: int):

    if N %2 == 1 or (N <= 5):
        for x in range(1, M+1): 
            print("{} {}".format(x, N+1-x))
    else:
        m = 0
        for x in range(1, (N-1)//4):
            print("{} {}".format(x, N+1-x))
            m += 1
            if m == M : return
        for x in range((N-1)//4, (N-1)//2+1):
            print("{} {}".format(x+1, N+1-x))
            m += 1
            if m == M : return

    raise
        
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    solve(N, M)

if __name__ == '__main__':
    main()
