#include <stdio.h>

#define N 65536

int h[N], numof, n;

inline void swap(int &a, int &b)  {
	int t(a);  a=b;  b=t;
}

inline void up(int i)  {
	int p;
	while((p=i/2)>0&&(h[p]>h[i]))  {
		swap(h[i], h[p]);
		i=p;
	}
}

int main()  {
	int i;
	freopen("heapsort.in", "r", stdin);
	freopen("heapsort.out", "w", stdout);

	scanf("%d", &n);

	numof=1;
	h[1]=1;
	for(i=2; i<=n; i++)  {		
		up(numof);
		h[1]=i;
		h[++numof]=1;
	}

	for(i=1; i<=n; i++)  {
		printf("%d", h[i]);	
		if(i<n)  printf(" ");
	}

	return 0;
}