#include <bits/stdc++.h>
using namespace std;
void solve() {
int N, K;
cin >> N >> K;
int S = 1;
while (S * (S - 1) / 2 < K)
++S;
int diff = S * (S - 1) / 2 - K;
int swap_value = N - diff;
for (int i = 1; i <= N - S; ++i)
cout << i << ' ';
cout << swap_value << ' ';
for (int i = N; i >= N - S + 1; --i)
if (i != swap_value)
cout << i << ' ';
cout << endl;
}
int main() {
assert(freopen("farfurii.in", "r", stdin));
assert(freopen("farfurii.out", "w", stdout));
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
solve();
return 0;
}