#include <bits/stdc++.h>
using namespace std;
int main(){
vector<int> v;
int n;
cin>>n;
for(int i=1;i<=2*n+1;i+=2)
v.push_back(i);
sort(v.begin(), v.end());
do {
for(int i=0;i<n;i++)
cout<<v.at(i)<<' ';
cout<<endl;
} while (next_permutation(v.begin(), v.end()));
return 0;
}