using System;
using System.Collections.Generic;
using System.Diagnostics.SymbolStore;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp4
{
    internal class Program
    {

        static int checkAnswer(int[] a, int[] b)
        {


            int Sum = 0;

            for (int i = 0; i < a.Length - 1; i++)
            {
                Sum += Math.Abs(a[i] - a[i + 1]);
            }

            for (int i = 0; i < b.Length - 1; i++)
            {
                Sum += Math.Abs(b[i] - b[i + 1]);
            }

            return Sum;
        }

        static int[] deepCopy(int[] t)
        {
            int[] copy = new int[t.Length];

            for (int i = 0; i < t.Length; i++)
            {
                copy[i] = t[i];
            }
            return copy;
        }
        static List<int[]> GetAllCombinations(int n)
        {
            n = n * 2;
            List<int[]> possible = new List<int[]>();
            HashSet<int> Counter = new HashSet<int>();
            int[] digits = new int[n];

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

            bool running = true;
            while (running)
            {
                digits[0]++;

                for (int i = 0; i < n; i++)
                {
                    if (digits[i] > n)
                    {
                        if (i == n - 1)
                        {
                            running = false;
                            break;
                        }
                        else
                        {
                            digits[i] = 1;
                            digits[i + 1]++;
                        }
                    }
                    else break;
                }

                Counter.Clear();
                bool valid = true;
                for (int j = 0; j < n; j++)
                {
                    if (Counter.Contains(digits[j]))
                    {
                        valid = false;
                        break;
                    }
                    else Counter.Add(digits[j]);
                }

                if (valid)
                {
                    possible.Add(deepCopy(digits));
                }
            }

            return possible;
        }

        static void brute(int n)
        {
            List<int[]> possible = GetAllCombinations(n);

            int Best = 0;

            foreach (int[] nums in possible)
            {
                int[] a = new int[n];
                int[] b = new int[n];

                for (int i = 0; i < n; i++)
                {
                    a[i] = nums[i];
                    b[i] = nums[(n * 2) - 1 - i];
                }
                //Console.WriteLine("A: ");
                //foreach (var item in a)
                //{
                //    Console.Write(item + " ");

                //}
                //Console.WriteLine();
                //Console.WriteLine("B: ");
                //foreach (var item in b)
                //{
                //    Console.Write(item + " ");
                //}
                //Console.WriteLine();
                //Console.WriteLine("_____________________");

                int current = checkAnswer(a, b);
                if (current > Best)
                {
                    Best = current;
                }
            }
            foreach (int[] nums in possible)
            {
                int[] a = new int[n];
                int[] b = new int[n];

                for (int i = 0; i < n; i++)
                {
                    a[i] = nums[i];
                    b[i] = nums[(n * 2) - 1 - i];
                }
                //Console.WriteLine("A: ");
                //foreach (var item in a)
                //{
                //    Console.Write(item + " ");

                //}
                //Console.WriteLine();
                //Console.WriteLine("B: ");
                //foreach (var item in b)
                //{
                //    Console.Write(item + " ");
                //}
                //Console.WriteLine();
                //Console.WriteLine("_____________________");

                int current = checkAnswer(a, b);
                if (current == Best)
                {
                    Console.Write("A: ");
                    foreach (var item in a)
                    {
                        Console.Write(item + " ");

                    }
                    Console.WriteLine();
                    Console.Write("B: ");
                    foreach (var item in b)
                    {
                        Console.Write(item + " ");
                    }
                    Console.WriteLine();
                    Console.WriteLine("-----");
                }
            }

            Console.WriteLine(Best);

        }

        static void Main(string[] args)
        {
           // brute(3);


            int n = int.Parse(Console.ReadLine());

            int[] a = new int[n];
            int[] b = new int[n];

            List<int> aTemp1 = new List<int>();
            List<int> bTemp1 = new List<int>();
            List<int> aTemp2 = new List<int>();
            List<int> bTemp2 = new List<int>();
            if (n % 2 == 0)
            {
                for (int i = 1; i <= n; i++)
                {
                    if (i % 2 == 0)
                    {
                        bTemp1.Add(i);
                    }
                    else
                    {
                        aTemp1.Add(i);
                    }
                }

                for (int i = n * 2; i > n; i--)
                {
                    if (i % 2 != 0)
                    {
                        aTemp2.Add(i);
                    }
                }

                for (int i = n + 1; i <= n * 2; i++)
                {
                    if (i % 2 == 0)
                    {

                        bTemp2.Add(i);
                    }
                }

                // B
                for (int i = 0; i < n; i++)
                {
                    if (i % 2 == 0)
                    {
                        if (bTemp2.Count - 1 < i / 2) continue;
                        b[i] = bTemp2[i / 2];
                    }
                    else b[i] = bTemp1[i / 2];
                }


                // A
                for (int i = 0; i < n; i += 2)
                {
                    if (aTemp1.Count - 1 < i / 2) continue;
                    a[i] = aTemp1[(aTemp1.Count - 1) - (i / 2)];
                }

                for (int i = 1; i < n; i += 2)
                {
                    a[i] = aTemp2[(i / 2)];
                }
            } else
            {
                string fill = "aFirst";
                int count = 0;
                for (int i = 1; i <= n * 2 ; i++)
                {
                    if (i < n)
                    {
                        if (i % 2 == 0) aTemp1.Add(i);
                        else bTemp1.Add(i);
                    } else
                    {
                        if (fill == "aFirst")
                        {
                            aTemp2.Add(i);
                            fill = "b";
                        } else if (fill == "a") {
                            aTemp2.Add(i);
                            count++;
                            if (count >= 2)
                            {
                                fill = "b";
                                count = 0;
                            }
                        }
                        else
                        {
                            bTemp2.Add(i);

                            count++;

                            if (count >= 2)
                            {
                                fill = "a";
                                count = 0;
                            }
                        }
                    }
                }

                // B
                for (int i = 0; i < n; i++)
                {
                    if (i % 2 == 0)
                    {
                        if (bTemp2.Count - 1 < i / 2) continue;
                        b[i] = bTemp2[i / 2];
                    }
                    else b[i] = bTemp1[i / 2];
                }


                // A

                int Take = 0;

                for (int i = 0; i < n; i++)
                {
                    if (Take == 0)
                    {
                        if (aTemp1.Count - 1 < i / 2) continue;
                        a[i] = aTemp1[(aTemp1.Count - 1) - (i / 2)];
                    } else
                    {
                        if (aTemp2.Count - 1 < i / 2) continue;
                        a[i] = aTemp2[(aTemp2.Count - 1) - (i / 2)];
                    }
                    Take++;
                    if (Take > 2)
                    {
                        Take = 0;
                    }
                }
            }


            //foreach (int item in aTemp1)
            //{
            //    Console.Write(item + " ");
            //}

            //foreach (int item in aTemp2)
            //{
            //    Console.Write(item + " ");
            //}


            
            string aOut = "";
            string bOut = "";
            foreach (int i in a)
            {
                aOut += i + " ";
                if (i % 1000 == 0)
                {
                    Console.Write(aOut);
                    aOut = "";
                }
            }

            Console.Write(aOut + "\n");

            foreach (int i in b)
            {
                bOut += i + " ";
                if (i % 1000 == 0)
                {
                    Console.Write(bOut);
                    bOut = "";
                }
            }
            Console.Write(bOut + "\n");

            Console.WriteLine(checkAnswer(a, b));
        }
    }
}