Petya has n integers: 1, 2, 3, ..., n. He wants to split these integers in two non-empty groups in such a way that the absolute difference of sums of integers in each group is as small as possible. 

Help Petya to split the integers. Each of n integers should be exactly in one group.

Input

The first line contains a single integer n (2 ≤ n ≤ 60 000) — the number of integers Petya has.

Output

Print the smallest possible absolute difference in the first line.

In the second line print the size of the first group, followed by the integers in that group. You can print these integers in arbitrary order. If there are multiple answers, print any of them.

Examples

Input

4


Output

0
2 1 4 


Input

2


Output

1
1 1 

Note

In the first example you have to put integers 1 and 4 in the first group, and 2 and 3 in the second. This way the sum in each group is 5, and the absolute difference is 0.

In the second example there are only two integers, and since both groups should be non-empty, you have to put one integer in the first group and one in the second. This way the absolute difference of sums of integers in each group is 1.

import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;

/**
 * Created by imahmoud on 5/13/17.
 */
public class C {
    static class Writer {
        private OutputStream out;
        public Writer(){
             out = new BufferedOutputStream(System.out);
        }

        public void println() throws IOException {
            out.write('\n');
        }
        public void println(String str) throws IOException {
            this.print(str);
            out.write('\n');
        }
        public void println(char v) throws IOException {
            this.print(v);
            out.write('\n');
        }
        public void println(short v) throws IOException {
            this.print(v);
            out.write('\n');
        }
        public void println(int v) throws IOException {
            this.print(v);
            out.write('\n');
        }
        public void println(long v) throws IOException {
            this.print(v);
            out.write('\n');
        }
        public void println(double v) throws IOException {
            this.print(v);
            out.write('\n');
        }
        public void println(float v) throws IOException {
            this.print(v);
            out.write('\n');
        }

        public void print(String str) throws IOException {
            out.write(str.getBytes());
        }
        public void print(char v) throws IOException {
            out.write(String.valueOf(v).getBytes());
        }
        public void print(short v) throws IOException {
            out.write(String.valueOf(v).getBytes());
        }
        public void print(int v) throws IOException {
            out.write(String.valueOf(v).getBytes());
        }
        public void print(long v) throws IOException {
            out.write(String.valueOf(v).getBytes());
        }
        public void print(double v) throws IOException {
            out.write(String.valueOf(v).getBytes());
        }
        public void print(float v) throws IOException {
            out.write(String.valueOf(v).getBytes());
        }

        public void flush() throws IOException {
            out.flush();
            out.close();
        }
    }
    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

    String f0 = "What are you doing at the end of the world? Are you busy? Will you save us?";
    String m1 = "What are you doing while sending \"";
    String m2 = "\"? Are you busy? Will you send \"";
    String m3 = "\"?";

    public char rec (long[] dp, long index, int f){
        if(f == 0){
            return index < f0.length() ? f0.charAt((int)index) : '.';
        }

        if(index < m1.length()){
            return m1.charAt((int)index);
        }else {
            index -=m1.length();
        }

        if(index < dp[f-1]){
            return rec(dp, index, f-1);
        }else{
            index -= dp[f-1];
        }

        if(index < m2.length()){
            return m2.charAt((int)index);
        }else{
            index -=m2.length();
        }

        if(index < dp[f-1]){
            return rec(dp, index, f-1);
        }else{
            index -= dp[f-1];
        }

        if(index < m3.length()){
            return m3.charAt((int)index);
        }
        return '.';
    }


    public void solve() throws IOException {
        Scanner in =  new Scanner(System.in);
        Writer out = new Writer();
        int N =  in.nextInt();

        if(N == 1){
            out.println("1");
            out.println("1 1");
        }else {
           
            boolean take = true;
            ArrayList<Integer> list = new ArrayList<>();
            long c1 = 0;
            long c2 = 0;
            for (int i = N; i > 0; ) {
                if(take){
                    list.add(i);
                    c1+=i;
                    if( i-1!= 0) {
                        c2 += i-1;
                    }
                }else {
                    c2 += i;
                    if( i-1!= 0) {
                        list.add(i-1);
                        c1 += i-1;
                    }
                }
                i-=2;
                take = !take;
            }
            
            out.println(Math.abs(c1 - c2));
            out.print(list.size());
            for (int i = 0; i < list.size(); i++) {
                out.print(" "+list.get(i));
            }


        }


        out.flush();
    }
    public static void main(String[] args)  throws Exception{
        try {
            new C().solve();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
