#include <stdio.h>

int mas[50010];

int main( ){
	int n;
	int i,j,k;

	freopen("heapsort.in", "rt",stdin);
	freopen("heapsort.out", "wt",stdout);
	

	for( i = 0; i<50010; i++)
		mas[i] = 0;

	mas[0] = 1;
	scanf("%d",&n);
	for( i = 1; i<n; i++ ){
		int j = i-1;
		while( j > 0 ){
			k = mas[(j-1)/2];
			mas[(j-1)/2] = mas[j];
			mas[j] = k;
			j = (j-1)/2;
		}
		mas[0] = i+1;
		mas[i] = 1;
	}

	for( i = 0; i<n; i++)
		printf("%d ",mas[i]);
	printf("\n");

	return 0;
}