#include <bits/stdc++.h>
using namespace std;
void Yes(){cout << "YES\n";}
void No(){cout << "NO\n";}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    auto nCr = [&](long long n,long long r) -> long long {
        if(n < r || n < 0 || r < 0) return 0;
        r = min(r,n-r);
        long long ret = 1;
        for(int i=1; i<=r; i++) ret *= n--,ret /= i;
        return ret;
    };

    int N; int i; cin >> N >> i;
    bool space = false;
    while(N > 0){
        if(space) cout << " ";
        space = true;
        if(i == 1){cout << N; break;}
        
        int now = i;
        while(true){
            now++;
            long long v = nCr(now,i);
            if(v > N) break; 
        }
        now--;
        cout << now;
        N -= nCr(now,i); i--;
    }
    cout << endl;
}