#include <fstream>

using namespace std;

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

int h[50001]; 

int main()
{
	int i, n, t, j; 
	for (i = 1; i <= 50000; i++)
		h[i] = i; 
	
	fin >> n; 

	for (i = 1; i <= n; i++)
	{
		t = h[i];  //swap done
		h[i] = h[1]; 
		h[1] = t; 
		if (i < n)
		{
			j = i; 
			while (j / 2 > 0)
			{
				t = h[j/2]; 
				h[j/2] = h[j];
				h[j] = t; 
				j = j/2; 
			}
		}
		
	}
	for (i = 1; i<= n; i++)
	{
		fout << h[i] << ((i!=n)?" ":"\n"); 
	}
	return 0;
}