#include <fstream.h>
#include <math.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

long N;

void Input(){
	cin >> N;
}
long mas[500010];

void Heapify(long n){
	while (n){
		long next = (n + 1) / 2 - 1;
		long t = mas[n];
		mas[n] = mas[next];
		mas[next] = t;
		n = next;
	}
}

void Solve(){
	mas[0] = 1;
	for (long i = 2; i <= N; i++){
		mas[i - 1] = 1;
		mas[i - 2] = i;
		Heapify(i - 2);
	}
}

void Output(){
	for (long i = 0; i < N; i++){
		if (i)
			cout << " ";
		cout << mas[i];
	}
}
int main(){
	ifstream fi("heapsort.in");
	ofstream fo("heapsort.out");
	cin = fi;
	cout = fo;
	Input();
	Solve();
	Output();
	return 0;
}
