#include<iostream>
#include<fstream>
using namespace std;
ifstream fin("submultimi.in");
ofstream fout("submultimi.out");
int n, stack[101];
void print_solution(int level)
{
for(int i=1; i<=level; i++)
cout<< stack[i]<<" " ;
cout<<endl;
}
void solve(int level)
{
if(level<=n)
{
for(int i = stack[level-1]+1; i<=n; ++i)
{
stack[level]=i;
print_solution(level);
solve(level+1);
}
}
}
int main()
{
n=4;
solve(1);
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGZzdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cmlmc3RyZWFtIGZpbigic3VibXVsdGltaS5pbiIpOwpvZnN0cmVhbSBmb3V0KCJzdWJtdWx0aW1pLm91dCIpOwppbnQgbiwgc3RhY2tbMTAxXTsKdm9pZCBwcmludF9zb2x1dGlvbihpbnQgbGV2ZWwpCnsKICAgIGZvcihpbnQgaT0xOyBpPD1sZXZlbDsgaSsrKQogICAgICAgIGNvdXQ8PCBzdGFja1tpXTw8IiAiIDsKICAgIGNvdXQ8PGVuZGw7Cn0Kdm9pZCBzb2x2ZShpbnQgbGV2ZWwpCnsKICAgIGlmKGxldmVsPD1uKQogICAgewogICAgICAgIGZvcihpbnQgaSA9IHN0YWNrW2xldmVsLTFdKzE7IGk8PW47ICArK2kpCiAgICAgICAgewogICAgICAgICAgICBzdGFja1tsZXZlbF09aTsKICAgICAgICAgICAgcHJpbnRfc29sdXRpb24obGV2ZWwpOwogICAgICAgICAgICBzb2x2ZShsZXZlbCsxKTsKICAgICAgICB9CiAgICB9Cn0KaW50IG1haW4oKQp7CiAgICBuPTQ7CiAgICBzb2x2ZSgxKTsKICAgIHJldHVybiAwOwp9Cg==