int ans[maxn]; intmain(){ ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
cin >> n >> k >> m; f[n + 1][0] = 1; for (int i = n + 1; i > 1; --i) { for (int j = 0; j <= m; ++j) { int l = j, r = min(j + n - i + 1, m); f[i - 1][l] += f[i][j]; f[i - 1][r + 1] -= f[i][j]; } for (int j = 1; j <= m; ++j) f[i - 1][j] += f[i - 1][j - 1]; for (int j = 0; j <= m; ++j) f[i - 1][j] = min(f[i - 1][j], k + 1); } for (int i = 1; i <= n; ++i) { ll s = 0; for (int j = 1; j <= n; ++j) { if (use[j]) continue; int c = 0; for (int k = 1; k < j; ++k) c += !use[k]; if (f[i + 1][m - c] + s >= k) { ans[i] = j; use[j] = 1; m -= c; k -= s; break; } s += f[i + 1][m - c]; } } for (int i = 1; i <= n; ++i) cout << ans[i] << " "; return0; }