#include <stdio.h>

int n;
int a[100000];

int main()
{
	int i, j, k, t;
	freopen("heapsort.in", "rt", stdin);
	freopen("heapsort.out", "wt", stdout);
	scanf("%d", &n);
	a[1] = 1;
	for (k = 2; k <= n; k++)
	{
		i = k-1;
		while (i > 1)
		{
			j = i/2;
			t = a[i]; a[i] = a[j]; a[j] = t;
			i = j;
		}
		a[k] = a[1]; a[1] = k;
	}
	for (i = 1; i <= n; i++)
	{
		printf("%d%c", a[i], i==n ? '\n' : ' ');
	}
	return 0;
}