#include <fstream>

int n,a[10000];

using namespace std;
ifstream fi("taphop.inp");
ofstream fo("taphop.out");

int nhap()
{
    fi >> n;
}

int xuat(int q)
{
    for (int i = 1; i <= q; i++) fo << a[i] << " ";
    fo << endl;
}

int th(int m)
{
    for (int j = a[m-1] + 1; j <= n; j++)
    {
        a[m] = j;
        xuat(m);
        if (m < n) th(m+1);
    }
}
int main()
{
    nhap();
    a[0] = 0;
    th(1);
    return 0;
}

