#include<fstream.h>

int heap[50009];

int main()
{
	ifstream cin("heapsort.in");
	ofstream cout("heapsort.out");
	int n;
	cin >> n;
	heap[1] = 1;
	for (int i = 2; i <= n; i++)
	{
		heap[i] = 1;
		heap[i-1] = i;
		int k = i-1;
		int j = (i-1)/2;
		while (j > 0)
		{
			int t = heap[k];
			heap[k] = heap[j];
			heap[j] = t;
			k = j;
			j /= 2;
		}
	}
	for (i = 1; i <= n; i++)
		cout << heap[i] << " ";
	cout<<endl;
	return 0;
}