#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define N 100000
int n, k;
int t[N+1] = {0};
bool s[N+1] = {0};
deque<int> pre;
deque<int> post;
int main() {
cin.sync_with_stdio(0);
cin >> n >> k;
for(int i = 1; i <= n; ++i) {
t[i] = i;
}
int kk = k;
for(int i = n; i >= 1; --i) {
if(i - 1 <= kk) {
pre.push_back(i);
kk -= i - 1;
} else {
post.push_front(i);
}
}
stringstream ss;
for(int i : pre) ss << i;
for(int i : post) ss << i;
for(int i = 0; i < ss.str().size(); ++i) {
cout << ss[i] << " ";
}
cout << "\n";
}