#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int N, K, X, Y, i;
int main()
{
freopen("farfurii.in","r",stdin);
freopen("farfurii.out","w",stdout);
scanf("%d%d", &N, &K);
X = 8* K + 1;
X = (double)sqrt((double)X);
X = (X + 1)/2;
if( X*(X-1) == 2*K)
{
for ( i = 1; i <= N - X; i++)
printf("%d ", i);
for ( i = N; i > N - X; i--)
printf("%d ", i);
}
else
{
Y = K - X*( X - 1)/2;
for ( i = 1; i <= N - X - 1; i++)
printf("%d ", i);
printf("%d ", N - X + Y);
for ( i = N; i > N - X + Y; i--)
printf("%d ", i);
for ( i = N - X + Y - 1; i > N - X - 1; i--)
printf("%d ", i);
}
}