#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int a[12][12],b[12],c[12];
int main(){
int n,sum,answ;
a[1][1] = 1;
for(int i = 2;i<=10;++i){
for(int j = 1;j<=i;++j){
if(j == 1||j == i)
a[i][j] = 1;
else
a[i][j] = a[i-1][j] + a[i-1][j-1];
}
}
while(cin>>n>>sum){
for(int i = 1;i<=n;++i)
b[i] = i;
do{
answ = 0;
for(int i = 1;i<=n;++i)
answ += b[i]*a[n][i];
if(answ == sum) break;
}while(next_permutation(b+1,b+n+1));
for(int i = 1;i<=n;++i){
if(i != n)
cout<<b[i]<<” “;
else
cout<<b[i]<<endl;
}
}
return 0;
}