#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int k,n,x[100];
bool ok=true;

void init(){
	cin>>n>>k;
	for(int i=1;i<=k;i++){
		x[i]=i;
	}
}
void result(){
	for(int i=1;i<=k;i++){
		cout<<x[i]<<" ";
	}
	cout<<endl;
}
void next_combination(){
	int i=k;
	while(i>=0&&x[i]==n-k+i){
		i--;
	}
if(i>=0){
	x[i]=x[i]+1;
	for(int j=i+1;j<=k;j++){
		x[j]=x[i]+j-i;
	}
}
else ok=false;}
int main(){
init(); 
while(ok){
	result();
	next_combination();
}
return 0;
}
