#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;cin>>n;

    int l = 1, r = 2 * n;
    int ctr = 0;

    while (ctr < n){
        int m = (r + l) / 2;

        cout<<m<<' ';
        ++ctr;

        if (ctr < n){
            cout<<r<<' ';
            ++ctr;
        }

        if (ctr < n){
            cout<<l<<' ';
            ++ctr;
        }

        l++;
    }

    cout<<endl;


    vector<int> vec(n * 2);

    for (int i = 0; i < n * 2; ++i){
        vec[i] = i + 1;
    }

    if (n <= 5){
        vector<int> m;
        int msum = 0;

        do{
            int sum = 0;
            for (int i = 1; i < n; ++i){
                sum += abs(vec[i] - vec[i - 1]);
            }
            for (int i = n + 1; i < 2 * n; ++i){
                sum += abs(vec[i] - vec[i - 1]);
            }

            if (sum > msum){
                m = vec;
                msum = sum;
            }
        }while(next_permutation(vec.begin(), vec.end()));

        cout<<msum<<endl;

        for (int i = 0; i < n; ++i){
            cout<<m[i]<<' ';
        }

        cout<<endl;

        for (int i = 0; i < n; ++i){
            cout<<m[i + n]<<' ';
        }

        cout<<endl<<endl;

        return 0;
    }

    /*if (n <= 1000){
        vector<vector<pair<int, int>>> dp(n, vector<pair<int, int>>(n));
        for (int i = 0; i < n; ++i){
            for (int j = 0; j < n; ++j){
                int add = i + j + 1;
                int inI = i > 0 ? (dp[i - 1][j].first + abs(dp[i - 1][j].second - add)) : 0;
                int inJ = j > 0 ? (dp[i][j - 1].first + abs(dp[i][j - 1].second - add)) : 0;

                dp[i][j] = {max(inI, inJ), add};
            }
        }

        cout<<dp[n - 1][n - 1].first;
        return 0;
    }


    vector<int> vec(n * 2);



    for (int i = 0; i < n * 2; ++i){
        vec[i] = i + 1;
    }

    if (n <= 5){
        vector<int> m;
        int msum = 0;

        do{
            int sum = 0;
            for (int i = 1; i < n; ++i){
                sum += abs(vec[i] - vec[i - 1]);
            }
            for (int i = n + 1; i < 2 * n; ++i){
                sum += abs(vec[i] - vec[i - 1]);
            }

            if (sum > msum){
                m = vec;
                msum = sum;
            }
        }while(next_permutation(vec.begin(), vec.end()));

        for (int i = 0; i < n; ++i){
            cout<<m[i]<<' ';
        }

        cout<<endl;

        for (int i = 0; i < n; ++i){
            cout<<m[i + n]<<' ';
        }

        return 0;
    }

    int l = 1, r = 2 * n - 1;

    for (int i = 0; i < n; ++i){
        if (i % 2 == 0){
            cout<<l<<' ';
            l+=2;
        }else{
            cout<<r<<' ';
            r-=2;
        }
    }

    cout<<endl;

    l = 2, r = 2 * n;

    for (int i = 0; i < n; ++i){
        if (i % 2 == 0){
            cout<<l<<' ';
            l+=2;
        }else{
            cout<<r<<' ';
            r-=2;
        }
    }*/



    return 0;
}