// Author: Adrian Kuegel
// Algorithm: pattern (derived from the dynamic programming solution)
// Complexity: O(n) time, O(1) space
#include <stdio.h>

int main() {
	int n;
//	freopen("cyclic.in", "r", stdin);
	while(scanf("%d", &n) == 1 && n) {
		int fac = 1;
		while(fac * 2 < n)
			fac *= 2;
		for (int i=1; i<n; ++i) {
			if (i&1) {
				while(i*fac + 1 > n)
					fac /= 2;
				printf("%d ", i * fac + 1);
			}
			else
				printf("%d ", i/2);
		}
		printf("%d\n", (n+1)/2);
	}
	return 0;
}
