#include using namespace std; #define For(i, a, b) for(int i = (a); i < (b); i++) #define rep(i, n) For(i, 0, n) #define rFor(i, a, b) for(int i = (a); i >= (b); i--) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using lint = long long; using ld = long double; int INF = 2000000000; lint LINF = 1000000000000000000; struct SetupIo { SetupIo() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); } } setupio; int main() { int N, i; cin >> N >> i; if (N >= 15000 && i == 1) { cout << N << "\n"; return 0; } vector> comb(15000); rep(i, 15000) { comb[i].resize(min(101, i + 1)); } comb[0][0] = 1; For(i, 1, 15000) { rep(j, min(101, i + 1)) { if (j == 0 || j == i) { comb[i][j] = 1; } else { comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j]; } if (comb[i][j] > 100000000) { comb[i][j] = INF; } } } rFor(n, 15000 - 1, 0) { if (comb[n][i] <= N) { cout << n << " "; N -= comb[n][i]; i--; } if (N == 0) { break; } } cout << "\n"; }