#include <fstream>
#include <vector>

using namespace std;

ifstream input("taphop.inp");
ofstream output("taphop.out");

void print(vector <int> &sub)
{
	for (unsigned int i = 0; i < sub.size(); i++)
	{
		output << sub[i] << ' ';
	}
	output << '\n';
}

void taphop(int &n, vector <int> &sub, bool pass, int i = 0)
{
	if (i > n)
	{
		return;
	}
	if (pass)
	{
		sub.push_back(i);
		print(sub);
	}
	taphop(n, sub, true, i + 1);
	taphop(n, sub, false, i + 1);
	if (pass)
	{
		sub.pop_back();
	}
}

int main()
{
	int n;
	input >> n;
	vector<int> sub;
	taphop(n, sub, false);
	input.close();
	output.close();
	return 0;
}