#include <iostream>
#include <cmath>
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define defmod 1000000007
using namespace std;
int main(){
cin.sync_with_stdio(0);
cin.tie(0);
ll n, k; cin >> n >> k;
ll re[101010];
ll pos[101010] = {0};
for(int i = 0; i < n; i++){
re[i+1] = i+1;
pos[i+1] = i+1;
}
for(int i = 1; i <= n; i++){
bool ok = true;
if(i == 1){
if(abs(re[i]-re[i+1]) < k)
ok = false;
}
else if(i == n){
if(abs(re[i]-re[i-1]) < k)
ok = false;
}
else{
if(abs(re[i]-re[i+1]) < k)
ok = false;
if(abs(re[i]-re[i-1]) < k)
ok = false;
}
if(ok)
continue;
for(int kk = 1; abs(kk-re[i]) >= k; kk++){
int j = pos[kk];
if(j == i)
continue;
bool ok2 = true;
swap(re[i], re[j]);
swap(pos[re[i]], pos[re[j]]);
if(j < i){
if(i == 1){
if(abs(re[i]-re[i+1]) < k)
ok2 = false;
}
else if(i == n){
if(abs(re[i]-re[i-1]) < k)
ok2 = false;
}
else{
if(abs(re[i]-re[i+1]) < k)
ok2 = false;
if(abs(re[i]-re[i-1]) < k)
ok2 = false;
}
if(j == 1){
if(abs(re[j]-re[j+1]) < k)
ok2 = false;
}
else if(j == n){
if(abs(re[j]-re[j-1]) < k)
ok2 = false;
}
else{
if(abs(re[j]-re[j+1]) < k)
ok2 = false;
if(abs(re[j]-re[j-1]) < k)
ok2 = false;
}
}
else{
if(i == 1){
if(abs(re[i]-re[i+1]) < k)
ok2 = false;
}
else if(i == n){
if(abs(re[i]-re[i-1]) < k)
ok2 = false;
}
else{
if(abs(re[i]-re[i+1]) < k)
ok2 = false;
if(abs(re[i]-re[i-1]) < k)
ok2 = false;
}
}
if(ok2){
//for(int i = 1; i <= n; i++){
// cout << re[i] << " ";
//}
//cout << endl << "on ok" << endl;
goto out;
}
else{
swap(re[j], re[i]);
swap(pos[re[i]], pos[re[j]]);
//for(int i = 1; i <= n; i++){
// cout << re[i] << " ";
//}
//cout << endl << "ei ollut ok" << endl;
}
}
for(int kk = re[i]+k; kk <= n; kk++){
int j = pos[kk];
if(j == i)
continue;
bool ok2 = true;
swap(re[i], re[j]);
swap(pos[re[i]], pos[re[j]]);
if(j < i){
if(i == 1){
if(abs(re[i]-re[i+1]) < k)
ok2 = false;
}
else if(i == n){
if(abs(re[i]-re[i-1]) < k)
ok2 = false;
}
else{
if(abs(re[i]-re[i+1]) < k)
ok2 = false;
if(abs(re[i]-re[i-1]) < k)
ok2 = false;
}
if(j == 1){
if(abs(re[j]-re[j+1]) < k)
ok2 = false;
}
else if(j == n){
if(abs(re[j]-re[j-1]) < k)
ok2 = false;
}
else{
if(abs(re[j]-re[j+1]) < k)
ok2 = false;
if(abs(re[j]-re[j-1]) < k)
ok2 = false;
}
}
else{
if(i == 1){
if(abs(re[i]-re[i+1]) < k)
ok2 = false;
}
else if(i == n){
if(abs(re[i]-re[i-1]) < k)
ok2 = false;
}
else{
if(abs(re[i]-re[i+1]) < k)
ok2 = false;
if(abs(re[i]-re[i-1]) < k)
ok2 = false;
}
}
if(ok2){
//for(int i = 1; i <= n; i++){
// cout << re[i] << " ";
//}
//cout << endl << "on ok" << endl;
goto out;
}
else{
swap(re[j], re[i]);
swap(pos[re[i]], pos[re[j]]);
//for(int i = 1; i <= n; i++){
// cout << re[i] << " ";
//}
//cout << endl << "ei ollut ok" << endl;
}
}
out:
continue;
}
re[0] = 99999999999LL;
re[n+1] = 999999999999LL;
for(int i = 1; i <= n; i++){
if(abs(re[i]-re[i+1]) < k || abs(re[i]-re[i-1]) < k){
cout << "QAQ" << endl;
return 0;
}
}
for(int i = 1; i <= n; i++){
cout << re[i] << " ";
}
cout << endl;
return 0;
}