#include <fstream>
#include <vector>
using namespace std;
ifstream cin("submultimi.in");
ofstream cout("submultimi.out");
int n;
vector<int> a;
bool urmator() {
for (int i = n; i >= 1; i--) {
if (a[i] == 0) {
a[i] = 1;
return true;
}
a[i] = 0; // Carry to the left
}
return false;
}
void afisare() {
cout << "{";
bool first = true;
for (int i = 1; i <= n; i++) {
if (a[i] == 1) {
if (!first) cout << ",";
cout << i;
first = false;
}
}
cout << "}\n";
}
int main() {
cin >> n;
a.resize(n + 1, 0); // Empty subset
do {
afisare();
} while (urmator());
}