using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static string InputPattern = "InputX";
static List<string> GetInputList()
{
var WillReturn = new List<string>();
if (InputPattern == "Input1") {
WillReturn.Add("3 2");
//2 1 3
}
else if (InputPattern == "Input2") {
WillReturn.Add("3 1");
//1 2 3
}
else {
string wkStr;
while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
}
return WillReturn;
}
static void Main()
{
List<string> InputList = GetInputList();
int[] wkArr = InputList[0].Split(' ').Select(pX => int.Parse(pX)).ToArray();
int N = wkArr[0];
int X = wkArr[1];
string Result = Solve(N, X);
Console.WriteLine(Result);
}
static string Solve(int pN, int pX)
{
// Nが偶数の場合
if (pN % 2 == 0) {
int Left = pN / 2;
int Right = Left + 1;
bool IsLeft = false;
if (Right <= pX) {
IsLeft = true;
}
return DeriveAnswer(Left, Right, IsLeft, pN, pX);
}
// Nが奇数の場合
if (pN % 2 == 1) {
int Left = pN / 2;
int Mid = Left + 1;
int Right = Mid + 1;
if (pX <= Left) {
return DeriveAnswer(Mid, Right, false, pN, pX);
}
if (pX == Mid) {
return DeriveAnswer(Mid, Right, false, pN, pX);
}
if (Right <= pX) {
return DeriveAnswer(Mid - 1, Mid, true, pN, pX);
}
}
return "";
}
// 解を求める
static string DeriveAnswer(int pLeft, int pRight, bool pIsLeft, int pN, int pX)
{
var AnswerList = new List<int>();
AnswerList.Add(pX);
while (true) {
if (pLeft < 1 && pN < pRight) break;
if (pIsLeft) {
if (pLeft == pX) {
pLeft--;
}
if (pLeft >= 1) {
AnswerList.Add(pLeft--);
}
pIsLeft = false;
continue;
}
else {
if (pRight == pX) {
pRight++;
}
if (pRight <= pN) {
AnswerList.Add(pRight++);
}
pIsLeft = true;
continue;
}
}
return IntEnumJoin(" ", AnswerList);
}
// セパレータとInt型の列挙を引数として、結合したstringを返す
static string IntEnumJoin(string pSeparater, IEnumerable<int> pEnum)
{
string[] StrArr = Array.ConvertAll(pEnum.ToArray(), pX => pX.ToString());
return string.Join(pSeparater, StrArr);
}
}