#include <algorithm>
#include <stdio.h>

FILE* in=fopen("heapsort.in","r");
//FILE* in=stdin;
FILE* out=fopen("heapsort.out","w");
//FILE* out=stdout;

long a[60000l];

inline void swap(const long c, const long d) {
	long t=a[c];
	a[c]=a[d];
	a[d]=t;
}

inline long pred(const long a) {
	return (a+1)/2-1;
}

int main()
{
	long n;
	fscanf(in,"%ld",&n);
	a[0]=1;
	long l,uk,p;
	for (l=2; l<=n; l++) {
		uk=l-2;
		while (uk>0) {
			p=pred(uk);
			swap(p,uk);
			uk=p;
		}
		a[l-1]=l;
		swap(0,l-1);
	}
	long i;
	for (i=0; i<n; i++)
		fprintf(out,"%ld%c",a[i],i<n-1?' ':'\n');
	return 0;
}