// Author: Christoph Schwirzer
#include <cstdio>
#include <vector>
#include <iostream>
#include <cassert>
using namespace std;
typedef vector<int> VI;
bool is_cyclic(VI v)
{
	int n = v.size(), k = 0;
	while (1)
	{
		if (n == 0)
			return true;
		if (!v[k])
			break;
		int &r = v[k];
		k = v[k] - 1;
		r = 0;
		n--;
	}
	return false;
}
bool is_antimonotonic(VI v)
{
	int n = v.size();
	for (int i=1; i+1<n; i++)
		if (v[i-1] < v[i] && v[i] < v[i+1] || v[i-1] > v[i] && v[i] > v[i+1])
			return false;
	return true;
}
void print(VI v)
{
	int n = v.size();
	for (int i=0; i<n; i++)
	{
		if (i)
			cout << " ";
		cout << v[i];
	}
	cout << endl;
}
int main()
{
//	freopen("cyclic.in", "r", stdin);
	int n;
	while (scanf("%d", &n), n)
	{
		assert(n >= 3);
		if (n % 2 == 1)
		{
			VI v;
			v.push_back(3);
			v.push_back(1);
			for (int i=2; i+1<n; i+=2)
			{
				v.push_back(i+3);
				v.push_back(i);
			}
			v.push_back(n-1);
			print(v);
			assert(is_cyclic(v) && is_antimonotonic(v));
		}
		else
		{
			VI v;
			v.push_back(3);
			v.push_back(1);
			for (int i=2; i+2<n; i+=2)
			{
				v.push_back(i+3);
				v.push_back(i);
			}
			v.push_back(n);
			v.push_back(n-2);
			print(v);
			assert(is_cyclic(v) && is_antimonotonic(v));

		}
	}
	return 0;
}
