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



l = m // 2 * 2 + 1

for i in range(1, l + 1):

    if i < l - i + 1:

        print((i, l - i + 1))



r = (m + 1) // 2 * 2 + l

for i in range(l + 1, r + 1):

    if i < r - i + l + 1:

        print((i, r - i + l + 1))

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



odd = (m + 1) // 2

even = m - odd



l = 1

r = 2 * odd

while l < r:

    print((l, r))

    l += 1

    r -= 1



l = n - 2 * even

r = n

while l < r:

    print((l, r))

    l += 1

    r -= 1

n, m = list(map(int, input().split()))
l = m // 2 * 2 + 1
for i in range(1, l + 1):
    if i < l - i + 1:
        print((i, l - i + 1))
r = (m + 1) // 2 * 2 + l
for i in range(l + 1, r + 1):
    if i < r - i + l + 1:
        print((i, r - i + l + 1))

n, m = list(map(int, input().split()))
odd = (m + 1) // 2
even = m - odd
l = 1
r = 2 * odd
while l < r:
    print((l, r))
    l += 1
    r -= 1
l = n - 2 * even
r = n
while l < r:
    print((l, r))
    l += 1
    r -= 1

-l = m // 2 * 2 + 1 -for i in range(1, l + 1): -    if i < l - i + 1: -        print((i, l - i + 1)) -r = (m + 1) // 2 * 2 + l -for i in range(l + 1, r + 1): -    if i < r - i + l + 1: -        print((i, r - i + l + 1)) +odd = (m + 1) // 2 +even = m - odd +l = 1 +r = 2 * odd +while l < r: +    print((l, r)) +    l += 1 +    r -= 1 +l = n - 2 * even +r = n +while l < r: +    print((l, r)) +    l += 1 +    r -= 1