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