#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 1e6+7;
int a[N];
ll n, k, cnt;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n >> k;
int l = 1, r = n;
for(int i = 1; i <= n; i++){
if(cnt + (n - i) <= k){
cnt += (n - i);
a[r--] = i;
}
else{
a[l++] = i;
}
}
for(int i = 1; i <= n; i++) cout << a[i] << ' ';
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBsbCAgICAgICAgICAgICAgICAgIGxvbmcgbG9uZwpjb25zdCBpbnQgTiA9IDFlNis3OwoKaW50IGFbTl07CmxsIG4sIGssIGNudDsKCmludCBtYWluKCl7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOyBjaW4udGllKDApOyBjb3V0LnRpZSgwKTsKICAgIGNpbiA+PiBuID4+IGs7CiAgICBpbnQgbCA9IDEsIHIgPSBuOwogICAgZm9yKGludCBpID0gMTsgaSA8PSBuOyBpKyspewogICAgICAgIGlmKGNudCArIChuIC0gaSkgPD0gayl7CiAgICAgICAgICAgIGNudCArPSAobiAtIGkpOwogICAgICAgICAgICBhW3ItLV0gPSBpOwogICAgICAgIH0KICAgICAgICBlbHNlewogICAgICAgICAgICBhW2wrK10gPSBpOwogICAgICAgIH0KICAgIH0KICAgIGZvcihpbnQgaSA9IDE7IGkgPD0gbjsgaSsrKSBjb3V0IDw8IGFbaV0gPDwgJyAnOwogICAgcmV0dXJuIDA7Cn0=