#include <fstream>

using namespace std;

ifstream fin("heapsort.in");
ofstream fout("heapsort.out");

int a[50010];

void f(int size)
{
	if (size == 1) {
		a[1] = 2;
		a[2] = 1;
		return;
	}
	int x = size, t;
	while (x != 1) {
		t = a[x];
		a[x] = a[x / 2];
		a[x / 2] = t;
		x /= 2;
	}
	a[1] = size + 1;
	a[size + 1] = 1;
}

int main()
{
	int n, i;
	fin >> n;
	if (n == 1)
		fout << 1;
	else {
		for (i = 1; i < n; i++)
			f(i);
	
		for (i = 1; i <= n; i++)
			fout << a[i] << ' ';
	}
	return 0;
}

