N,M = map(int,input().split()) ANS = [-1 for i in range(N)] tmp = [] for i in range(N-1, -1, -1): if i == N-4: ans = [x for x in ANS] else: ans = [x for x in tmp] if i == N-1: ANS[i] = M continue if i == N-2: ANS[i] = -1 continue if i == N-3: ANS[i] = M ANS[i+1] = 0 ANS[i+2] = 0 continue if N - i > 2*M + 1: break rest = M required = int((N-i)/2) satisfied = 0 over1 = [] for j in range(N-1, i, -1): if ans[j] < 0: satisfied += 1 ans[j] = 0 elif ans[j] == 0: if satisfied < required: ans[j] = 1 rest -= 1 satisfied += 1 elif ans[j] >= 1: over1.append((ans[j], -j)) ans[j] = 0 if satisfied < required and len(over1) > 0 and rest > 1: over1.sort() while satisfied < required and len(over1) > 0: p,n = over1.pop(0) satisfied += 1 ans[-n] = p+1 rest -= p+1 if rest >= 0 and satisfied >= required: ans[i] = rest tmp = [x for x in ans] ANS = [x for x in ans] else: tmp = [x for x in ans] print(' '.join(map(str,ANS)))