#include <iostream>
#include <fstream>
#define FIN "partitiinumar.in"
#define FOUT "partitiinumar.out"
#define DIM 100
using namespace std;
ifstream fin( FIN );
ofstream fout( FOUT );
int n,
sum,
stack[ 101 ];
void solve(int level) {
if(sum == n) {
for(int i = 1; i < level; ++i) {
cout<<stack[i]<<" ";
}
cout<<endl;
} else {
if(level==1) stack[level] = 0;
else stack[level] = stack[level-1] - 1;
while(stack[level] + sum < n) {
stack[level]+=1;
sum += stack[level];
solve(level+1);
sum -= stack[level];
}
}
}
int main(int argc, char const *argv[]) {
sum = 0;
cin>>n;
solve(1);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2RlZmluZSBGSU4gInBhcnRpdGlpbnVtYXIuaW4iCiNkZWZpbmUgRk9VVCAicGFydGl0aWludW1hci5vdXQiCiNkZWZpbmUgRElNIDEwMAoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmlmc3RyZWFtIGZpbiggRklOICk7CgpvZnN0cmVhbSBmb3V0KCBGT1VUICk7CgppbnQgbiwKCiAgICBzdW0sCgogICAgc3RhY2tbIDEwMSBdOwoKdm9pZCBzb2x2ZShpbnQgbGV2ZWwpIHsKCiAgICAgaWYoc3VtID09IG4pIHsKCiAgICAgICBmb3IoaW50IGkgPSAxOyBpIDwgbGV2ZWw7ICsraSkgewoKICAgICAgICAgY291dDw8c3RhY2tbaV08PCIgIjsKCiAgICAgICB9CgogICAgICAgY291dDw8ZW5kbDsKCiAgICAgfSBlbHNlIHsKCiAgICAgICAgaWYobGV2ZWw9PTEpIHN0YWNrW2xldmVsXSA9IDA7CiAgICAgICAgCiAgICAgICAgZWxzZSBzdGFja1tsZXZlbF0gPSBzdGFja1tsZXZlbC0xXSAtIDE7CgogICAgICAgIHdoaWxlKHN0YWNrW2xldmVsXSArIHN1bSA8IG4pIHsKCiAgICAgICAgICAgICAgc3RhY2tbbGV2ZWxdKz0xOwoKICAgICAgICAgICAgICBzdW0gKz0gc3RhY2tbbGV2ZWxdOwoKICAgICAgICAgICAgICBzb2x2ZShsZXZlbCsxKTsKCiAgICAgICAgICAgICAgc3VtIC09IHN0YWNrW2xldmVsXTsKICAgICAgICB9CiAgICAgfQp9CgppbnQgbWFpbihpbnQgYXJnYywgY2hhciBjb25zdCAqYXJndltdKSB7CgogIHN1bSA9IDA7CiAgCiAgY2luPj5uOwogIAogIHNvbHZlKDEpOyAgICAKICAKICByZXR1cm4gMDsKCn0KCgoK