Permutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct positive integers not larger than n. We'll denote as n the length of permutation p1, p2, ..., pn.

Your task is to find such permutation p of length n, that the group of numbers |p1 - p2|, |p2 - p3|, ..., |pn - 1 - pn| has exactly k distinct elements.

Input

The single line of the input contains two space-separated positive integers n, k (1 ≤ k < n ≤ 105).

Output

Print n integers forming the permutation. If there are multiple answers, print any of them.

Examples

Input

3 2


Output

1 3 2


Input

3 1


Output

1 2 3


Input

5 2


Output

1 3 2 4 5

Note

By |x| we denote the absolute value of number x.

Source: codeforces | Difficulty: EASY
Tags: Greedy algorithms

Constructive algorithms


Solutions:
from collections import Counter
import string
import math
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
testcases = 1
for _ in range(testcases):
	(n, k) = vary(2)
	temp = k
	num = [i for i in range(1, n + 1)]
	j = 0
	for i in range(k + 1):
		if i % 2 == 0:
			print(num[j], end=' ')
			j += 1
		else:
			print(num[k], end=' ')
			k -= 1
	for i in range(temp + 1, n):
		print(num[i], end=' ')


(a, b) = map(int, input().split(' '))
for i in range(1, a - b + 1):
	print(i)
curr = i
if b % 2 == 0:
	for i in range(b, 0, -1):
		if i % 2 == 0:
			curr = curr + i
		else:
			curr = curr - i
		print(curr)
else:
	for i in range(b, 0, -1):
		if i % 2 == 1:
			curr = curr + i
		else:
			curr = curr - i
		print(curr)


(n, k) = (int(i) for i in input().split())
l = [i for i in range(1, n - k + 1)]
l1 = [i for i in range(n - k + 1, n + 1)]
k1 = 0
k2 = k - 1
for i in range(k):
	if i % 2 == 0:
		l.append(l1[k2])
		k2 -= 1
	else:
		l.append(l1[k1])
		k1 += 1
print(*l)


f = input()
(n, k) = map(int, f.split(' '))
x = n
y = 1
for i in range(k):
	if i % 2 == 0:
		print(x, end=' ')
		x -= 1
	else:
		print(y, end=' ')
		y += 1
bas = 0
t = 0
if k % 2 == 0:
	bas = y
	t = 1
else:
	bas = x
	t = -1
for i in range(n - k):
	print(bas, end=' ')
	bas += t


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	(n, k) = LI()
	l = 1
	r = n
	lf = 1
	rr = []
	while l <= r:
		if k == 1:
			if lf:
				rr.append(l)
				l += 1
			else:
				rr.append(r)
				r -= 1
			continue
		if lf:
			rr.append(l)
			l += 1
		else:
			rr.append(r)
			r -= 1
		lf ^= 1
		k -= 1
	return JA(rr, ' ')
print(main())


(n, k) = map(int, input().split())
b = ''
i = 1
j = n
c = 0
p = 0
while p < n:
	if c < k:
		if p % 2 == 0:
			b += str(i) + ' '
			i += 1
			c += 1
		else:
			b += str(j) + ' '
			j -= 1
			c += 1
	elif p % 2 == 1:
		for q in range(i, j + 1):
			b += str(q) + ' '
		print(b)
		exit(0)
	else:
		for q in range(j, i - 1, -1):
			b += str(q) + ' '
		print(b)
		exit(0)
	p += 1
print(b)


(n, k) = map(int, input().split())
(p, q) = (1, n)
rest = list()
for i in range(k):
	if i % 2 == 0:
		rest.append(p)
		p += 1
	else:
		rest.append(q)
		q -= 1
if k % 2 == 0:
	for i in range(q, p - 1, -1):
		rest.append(i)
else:
	for i in range(p, q + 1):
		rest.append(i)
print(' '.join(map(str, rest)))


([n, k], s) = (map(int, input().split()), [1])
for i in range(k, 0, -1):
	s.append(s[-1] + (-i if (k - i) % 2 else i))
print(*s + sorted(set(range(1, n + 1)) - set(s)))


(n, k) = map(int, list(input().split()))
for i in range(1, (k + 3) // 2):
	print(i, k + 2 - i, end=' ')
if k > 1 and k % 2 == 0:
	print(k // 2 + 1, end=' ')
for i in range(k + 2, n + 1):
	print(i, end=' ')


(n, k) = map(int, input().split())
a = []
k += 1
one = 0
two = 0
f = False
for i in range(1, n + 1):
	if i % 2 != 0:
		i -= one
		a.append(i)
		one += 1
	else:
		i -= two
		a.append(n + 2 - i)
		two += 1
	k -= 1
	if k == 1:
		f = True
		d = set(a)
		if len(a) % 2 == 0:
			for j in range(n - 1, 0, -1):
				if j not in d:
					a.append(j)
		else:
			for j in range(1, n + 1):
				if j not in d:
					a.append(j)
	if f:
		break
print(*a)


from sys import stdin, stdout
input = stdin.readline
(n, k) = map(int, input().split())

def f(n):
	n += 1
	l = []
	for i in range(1, 1 + n // 2):
		l.append(str(i))
		l.append(str(n - i + 1))
	if n % 2 == 1:
		l.append(str(n // 2 + 1))
	return l
ans = f(k)
for i in range(n - k - 1):
	ans.append(str(i + k + 2))
stdout.write(' '.join(ans))


(n, k) = map(int, input().split())
a = list(range(1, n + 1))
for i in range(1, k + 1):
	a[i] = a[i - 1] + (k - i + 1 if i & 1 else i - k - 1)
print(' '.join((repr(x) for x in a)))


__author__ = 'neki'
import sys
words = input().split()
n = int(words[0])
k = int(words[1])
perm = [1]
viz = [0 for x in range(n + 1)]
viz[1] = 1
dif = k
one = 1
while dif > 0:
	num = perm[len(perm) - 1] + one * dif
	perm.append(num)
	viz[num] = 1
	one *= -1
	dif -= 1
for i in range(1, n + 1):
	if viz[i] == 0:
		perm.append(i)
for i in range(n - 1):
	print(perm[i], end=' ')
print(perm[n - 1])


def arr_inp():
	return [int(x) for x in stdin.readline().split()]
from sys import stdin
from collections import *
(n, k) = arr_inp()
(ans, mem, c) = ([], defaultdict(int), 0)
for i in range(n - k):
	ans.append(i + 1)
	mem[i + 1] = 1
for i in range(k, 0, -1):
	ix = ans[-1]
	if c & 1:
		ix -= i
	else:
		ix += i
	if mem[ix] == 0:
		mem[ix] = 1
		ans.append(ix)
	c += 1
print(*ans)


from fractions import gcd
[n, k] = [int(s) for s in input().split()]
sign = 1
p = [0 for i in range(n)]
kk = k
p[0] = 1
i = 0
while kk > 0:
	p[i + 1] = p[i] + sign * kk
	i = i + 1
	sign = -sign
	kk = kk - 1
i = i + 1
if i < n:
	p[i] = k + 2
while i < n - 1:
	p[i + 1] = p[i] + 1
	i = i + 1
print(' '.join(map(str, p)))


from sys import stdin
lines = list(filter(None, stdin.read().split('\n')))

def parseline(line):
	return list(map(int, line.split()))
lines = list(map(parseline, lines))
(n, k) = lines[0]
x = n + 1
for i in range(n, n - k, -1):
	if (n - i) % 2 == 0:
		x = x - i
	else:
		x = x + i
	print(x, end=' ')
step = -1 if k % 2 == 0 else +1
for k in range(n - k):
	x += step
	print(x, end=' ')


(n, k) = map(int, input().split())
a = [x + 1 for x in range(n)]
l = 0
r = n - 1
p = 0
for i in range(k - 1):
	if p:
		print(a[r], end=' ')
		r -= 1
		p = not p
	else:
		print(a[l], end=' ')
		l += 1
		p = not p
p = not p
if p:
	for i in range(l, r + 1):
		print(a[i], end=' ')
else:
	for i in range(r, l - 1, -1):
		print(a[i], end=' ')


def getLine():
	return list(map(int, input().split()))
(n, k) = getLine()
l = [0] * n
for i in range(n):
	if i % 2 == 0:
		l[i] = i // 2 + 1
	else:
		l[i] = n - l[i - 1] + 1
ans = l
for i in range(k, n):
	if k % 2 == 0:
		l[i] = l[i - 1] - 1
	else:
		l[i] = l[i - 1] + 1
for i in ans:
	print(i, end=' ')


(n, k) = map(int, input().split())
i = 1
a = []
for j in range(n // 2):
	a.append(i)
	a.append(n - i + 1)
	i += 1
if n % 2 == 1:
	a.append(n // 2 + 1)
for i in range(k):
	print(a[i], end=' ')
if k < n and a[k - 1] > a[k]:
	s = a[k - 1] - 1
	for i in range(k, n):
		print(s, end=' ')
		s -= 1
else:
	s = a[k - 1] + 1
	for i in range(k, n):
		print(s, end=' ')
		s += 1


(n, k) = map(int, input().split())
L = []
for i in range(n + 1):
	L.append(i)
k1 = k
s = n * (n + 1) / 2 - 1
L[1] = 0
L[k + 1] = 0
print('1', k + 1, end=' ')
k = k - 1
b = k + 2
while s > 0:
	if k == 0:
		break
	if b - k > 0 and L[b - k] != 0:
		print(L[b - k], end=' ')
		L[b - k] = 0
		s -= b - k
		b = abs(b - k)
		k -= 1
	else:
		print(L[b + k], end=' ')
		L[b + k] = 0
		s -= b + k
		b = abs(b + k)
		k -= 1
for i in range(len(L)):
	if L[i] != 0:
		print(L[i], end=' ')