#include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
cin>>n;
for (int i=1; i<=n; i++) cout<<i<<" ";
cout<<endl;
for (int i=1; i<=n; i++)
if (i%2==0) cout<<i<<" ";
cout<<endl;
for (int i=1; i<=n; i++)
if (i%2==1 && i%3!=0) cout<<i<<" ";
}