n,m=map(int,input().split())

if n%2==1:

    [print(i+1,n-i) for i in range(m)]

else:

    [print(i+1,n-i) if i<m/2 else print(i+1,n-i-1) for i in range(m)]

n,m=list(map(int,input().split()))

if n%2==1:

    x=""

    for i in range(m):

        x+=f"{i+1} {n-i}\n"

    print(x)

else:

    x=""

    for i in range(m):

        x+=(f"{i+1} {n-i}\n" if i<m/2 else f"{i+1} {n-i-1}\n")

    print(x)
n, m = map(int, input().split())
if n % 2 == 1:
    [print(i + 1, n - i) for i in range(m)]
else:
    [print(i + 1, n - i) if i < m / 2 else print(i + 1, n - i - 1) for i in range(m)]

n, m = list(map(int, input().split()))
if n % 2 == 1:
    x = ""
    for i in range(m):
        x += f"{i+1} {n-i}\n"
    print(x)
else:
    x = ""
    for i in range(m):
        x += f"{i+1} {n-i}\n" if i < m / 2 else f"{i+1} {n-i-1}\n"
    print(x)

-n, m = map(int, input().split()) +n, m = list(map(int, input().split())) -    [print(i + 1, n - i) for i in range(m)] +    x = "" +    for i in range(m): +        x += f"{i+1} {n-i}\n" +    print(x) -    [print(i + 1, n - i) if i < m / 2 else print(i + 1, n - i - 1) for i in range(m)] +    x = "" +    for i in range(m): +        x += f"{i+1} {n-i}\n" if i < m / 2 else f"{i+1} {n-i-1}\n" +    print(x)