#include <cstdio>

const int N = 70000;
int heapSize = 0;
int heap[N];
void Swap(int& a, int &b)
{
	int t = a;
	a = b;
	b = t;
}
int heapIns(int k)
{
	int tmp = heapSize;
	while(tmp > 1)
	{
		heap[tmp] = heap[tmp/2];
		tmp = tmp/2;
	}
	heap[1] = k;
	heap[++heapSize] = 1;
	return heapSize;
}
int main()
{
	FILE *inf = fopen("heapsort.in","rt");
	FILE *outf = fopen("heapsort.out","wt");
	int n,i;
	fscanf(inf,"%ld",&n);
	for(i=1;i<=n;i++)
	{
		heapIns(i);
	}
	for(i=1;i<=n;i++)
		fprintf(outf,"%ld ",heap[i]);
	fclose(inf);
	fclose(outf);
	return 0;
}