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

ans = []

if N%2:

    for i in range(N//2):

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

else:

    m = N//2

    for i in range(m//2):

        ans.append((i+1, m-i))

    for i in range((m-1)//2):

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

for a,b in ans[:M]:

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

if N%2:

    for i in range(M):

        print((i+1, M*2-i))

else:

    b = M//2

    a = M - b

    for i in range(a):

        print((i+1, a*2-i))

    for i in range(b):

        print((a*2+1+i, M*2+1-i))
N, M = list(map(int, input().split()))
ans = []
if N % 2:
    for i in range(N // 2):
        ans.append((i + 1, N - 1 - i))
else:
    m = N // 2
    for i in range(m // 2):
        ans.append((i + 1, m - i))
    for i in range((m - 1) // 2):
        ans.append((m + i + 1, N - 1 - i))
for a, b in ans[:M]:
    print((a, b))

N, M = list(map(int, input().split()))
if N % 2:
    for i in range(M):
        print((i + 1, M * 2 - i))
else:
    b = M // 2
    a = M - b
    for i in range(a):
        print((i + 1, a * 2 - i))
    for i in range(b):
        print((a * 2 + 1 + i, M * 2 + 1 - i))

-ans = [] -    for i in range(N // 2): -        ans.append((i + 1, N - 1 - i)) +    for i in range(M): +        print((i + 1, M * 2 - i)) -    m = N // 2 -    for i in range(m // 2): -        ans.append((i + 1, m - i)) -    for i in range((m - 1) // 2): -        ans.append((m + i + 1, N - 1 - i)) -for a, b in ans[:M]: -    print((a, b)) +    b = M // 2 +    a = M - b +    for i in range(a): +        print((i + 1, a * 2 - i)) +    for i in range(b): +        print((a * 2 + 1 + i, M * 2 + 1 - i))