#include <iostream>
#include <fstream>
#define filein "partitiimultime.in"
#define fileout "partitiimultime.out"
using namespace std;
int n, stack[100];
ifstream fin(filein);
ofstream fout(fileout);
int maxim(int level) {
int max;
max = 0;
for(int i = 1; i < level; ++i) {
if(stack[i] > max) max = stack[i];
}
return max;
}
void display_partition() {
int max = maxim(n+1);
for (size_t i = 1; i <= max; i++) {
for(int j = 1; j <= n; ++j) {
if(stack[j] == i) cout<<j<<"";
}
cout<<"*";
}
cout<<endl;
}
void solve(int level) {
for(int i = 1; i <= maxim(level)+1; ++i) {
stack[level] = i;
if(level == n) {
display_partition();
} else solve(level+1);
}
}
int main(int argc, char const *argv[]) {
cin>>n;
stack[1] = 1;
solve(2);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2RlZmluZSBmaWxlaW4gInBhcnRpdGlpbXVsdGltZS5pbiIKI2RlZmluZSBmaWxlb3V0ICJwYXJ0aXRpaW11bHRpbWUub3V0IgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBuLCBzdGFja1sxMDBdOwppZnN0cmVhbSBmaW4oZmlsZWluKTsKb2ZzdHJlYW0gZm91dChmaWxlb3V0KTsKCmludCBtYXhpbShpbnQgbGV2ZWwpIHsKICBpbnQgbWF4OwogIG1heCA9IDA7CiAgZm9yKGludCBpID0gMTsgaSA8IGxldmVsOyArK2kpIHsKICAgIGlmKHN0YWNrW2ldID4gbWF4KSBtYXggPSBzdGFja1tpXTsKICB9CiAgcmV0dXJuIG1heDsKfQoKdm9pZCBkaXNwbGF5X3BhcnRpdGlvbigpIHsKICAgICBpbnQgbWF4ID0gbWF4aW0obisxKTsKICAgICBmb3IgKHNpemVfdCBpID0gMTsgaSA8PSBtYXg7IGkrKykgewogICAgICAgICAgZm9yKGludCBqID0gMTsgaiA8PSBuOyArK2opIHsKICAgICAgICAgICAgaWYoc3RhY2tbal0gPT0gaSkgY291dDw8ajw8IiI7CiAgICAgICAgICB9Ci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