#include <iostream>
using namespace std;
void combinationGen(int B[], int K, int N, bool &finished) {
int i = K;
while (i > 0 && B[i] == N - K + i) i--;
if (i == 0) {
finished = true;
} else {
B[i]++;
for (int j = i + 1; j <= K; j++) B[j] = B[i] + j - i;
}
}
void generateCombinations(int n, int k) {
int B[20];
bool finished = false;
for (int i = 1; i <= k; i++) B[i] = i;
while (!finished) {
for (int i = 1; i <= k; i++) {
cout << B[i] << " ";
}
cout << endl;
combinationGen(B, k, n, finished);
}
}
int main() {
int n, k;
cin >> k >> n;
generateCombinations(n, k);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCBjb21iaW5hdGlvbkdlbihpbnQgQltdLCBpbnQgSywgaW50IE4sIGJvb2wgJmZpbmlzaGVkKSB7CiAgICBpbnQgaSA9IEs7CiAgICB3aGlsZSAoaSA+IDAgJiYgQltpXSA9PSBOIC0gSyArIGkpIGktLTsKICAgIGlmIChpID09IDApIHsKICAgICAgICBmaW5pc2hlZCA9IHRydWU7CiAgICB9IGVsc2UgewogICAgICAgIEJbaV0rKzsKICAgICAgICBmb3IgKGludCBqID0gaSArIDE7IGogPD0gSzsgaisrKSBCW2pdID0gQltpXSArIGogLSBpOwogICAgfQp9Cgp2b2lkIGdlbmVyYXRlQ29tYmluYXRpb25zKGludCBuLCBpbnQgaykgewogICAgaW50IEJbMjBdOwogICAgYm9vbCBmaW5pc2hlZCA9IGZhbHNlOwogICAgZm9yIChpbnQgaSA9IDE7IGkgPD0gazsgaSsrKSBCW2ldID0gaTsKCiAgICB3aGlsZSAoIWZpbmlzaGVkKSB7CiAgICAgICAgZm9yIChpbnQgaSA9IDE7IGkgPD0gazsgaSsrKSB7CiAgICAgICAgICAgIGNvdXQgPDwgQltpXSA8PCAiICI7CiAgICAgICAgfQogICAgICAgIGNvdXQgPDwgZW5kbDsKICAgICAgICBjb21iaW5hdGlvbkdlbihCLCBrLCBuLCBmaW5pc2hlZCk7CiAgICB9Cn0KCmludCBtYWluKCkgewogICAgaW50IG4sIGs7CiAgICBjaW4gPj4gayA+PiBuOwogICAgZ2VuZXJhdGVDb21iaW5hdGlvbnMobiwgayk7CiAgICByZXR1cm4gMDsKfQo=