m, n = map(int, input().split())array = [[1, 1]]left = 0right = 1for i in range(n): arr = [[1, 1]] mid = (left + right) // 2 arr.insert(mid, arr[left] + arr[right]) array.append(arr) left += 1 right for row in arr: print(' '.join(map(str, row)))