include

include

include

include

include

define fi first

define se second

define MP make_pair

define P pair<int,int>

define PLL pair<ll,ll>

define lc (p<<1)

define rc (p<<1|1)

define MID (tree[p].l+tree[p].r)>>1

define Sca(x) scanf("%d",&x)

define Sca2(x,y) scanf("%d%d",&x,&y)

define Sca3(x,y,z) scanf("%d%d%d",&x,&y,&z)

define Scl(x) scanf("%lld",&x)

define Scl2(x,y) scanf("%lld%lld",&x,&y)

define Scl3(x,y,z) scanf("%lld%lld%lld",&x,&y,&z)

define Pri(x) printf("%d\n",x)

define Prl(x) printf("%lld\n",x)

define For(i,x,y) for(int i=x;i<=y;i++)

define _For(i,x,y) for(int i=x;i>=y;i--)

define FAST_IO std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);

define STOP system("pause")

define ll long long

const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
const double Pi = acos(-1.0);
using namespace std;
template <class t="">void tomax(T&a,T b){ a=max(a,b); }
template <class t="">void tomin(T&a,T b){ a=min(a,b); }
const int N=50+5;
int out[N],n,m;
void dfs(int num,int k){
if(k==m+1){
for(int i=1;i<k;i++)
printf("%d ",out[i]);
puts("");
return ;
}
if(num>n) return ;
out[k]=num;
dfs(num+1,k+1);
dfs(num+1,k);
}
int main(){
Sca2(n,m);
dfs(1,1);</class></class>

}