// Author: Adrian Kuegel
// Date: July 3rd, 2009

#include <stdio.h>
#include <assert.h>
#include <algorithm>
using namespace std;

#define MAXN 1000000

int p[MAXN], p_low[MAXN/2], p_high[MAXN/2];
int cycle_elems[MAXN];
bool visit[MAXN];
int n;

// tries to combine all cycles into one cycle by selecting from each
// cycle a number at an even position (which can by construction of the
// permutation be exchanged freely) and does a cyclic rotation of one of
// these selected positions. Now, all cycles are combined into one cycle.
bool fixable() {
	for (int i=0; i<n; ++i)
		visit[i] = false;
	int l = 0;
	for (int i=0; i<n; ++i) {
		if (visit[i])
			continue;
		int cur = i, high = -1;
		do {
			if (cur%2 == 0)
				high = cur;
			visit[cur] = true;
			cur = p[cur];
		}while(cur != i);
		// no even position found in the cycle?
		if (high < 0)
			return false;
		cycle_elems[l++] = high;
	}
	// do the cyclic rotation of the selected cycle elements
	int t = p[cycle_elems[0]];
	for (int i=1; i<l; ++i)
		p[cycle_elems[i-1]] = p[cycle_elems[i]];
	p[cycle_elems[l-1]] = t;
	return true;
}

int main() {
//	freopen("cyclic.in", "r", stdin);
	while(scanf("%d", &n) == 1 && n) {
		for (int i=0; i<n/2; ++i)
			p_low[i] = i;
		for (int i=n/2; i<n; ++i)
			p_high[i-n/2] = i;
		int cnt = 0;
		do {
			random_shuffle(p_low, p_low + n/2);
			random_shuffle(p_high, p_high + (n+1)/2);
			for (int i=0; i<n; ++i)
				if (i&1)
					p[i] = p_low[i/2];
				else
					p[i] = p_high[i/2];
			++cnt;
		}while(!fixable());
		// printf("%d\n", cnt);
		for (int i=0; i<n; ++i) {
			if (i) printf(" ");
			printf("%d", p[i] + 1);
		}
		puts("");
	}
	return 0;
}
