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

ans=[]

for i in range(m):

  ans.append([i+1,2*m-i])

if n%2==0:

  ans.reverse()

  flag=0

  for i in range(len(ans)):

    if ans[i][1]-ans[i][0]>=n//2:

      flag=1

    if flag==1:

      ans[i][1]+=1

  ans.reverse()

for i in range(len(ans)):

  print((ans[i][0],ans[i][1]))
n,m=list(map(int,input().split()))

for i in range(m):

  if n%2==0 and 2*m-i-i-1>=n//2:

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

  else:

    print((i+1,2*m-i))
n, m = list(map(int, input().split()))
ans = []
for i in range(m):
    ans.append([i + 1, 2 * m - i])
if n % 2 == 0:
    ans.reverse()
    flag = 0
    for i in range(len(ans)):
        if ans[i][1] - ans[i][0] >= n // 2:
            flag = 1
        if flag == 1:
            ans[i][1] += 1
    ans.reverse()
for i in range(len(ans)):
    print((ans[i][0], ans[i][1]))

n, m = list(map(int, input().split()))
for i in range(m):
    if n % 2 == 0 and 2 * m - i - i - 1 >= n // 2:
        print((i + 1, 2 * m - i + 1))
    else:
        print((i + 1, 2 * m - i))

-ans = [] -    ans.append([i + 1, 2 * m - i]) -if n % 2 == 0: -    ans.reverse() -    flag = 0 -    for i in range(len(ans)): -        if ans[i][1] - ans[i][0] >= n // 2: -            flag = 1 -        if flag == 1: -            ans[i][1] += 1 -    ans.reverse() -for i in range(len(ans)): -    print((ans[i][0], ans[i][1])) +    if n % 2 == 0 and 2 * m - i - i - 1 >= n // 2: +        print((i + 1, 2 * m - i + 1)) +    else: +        print((i + 1, 2 * m - i))