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.util.*;
import java.io.*;
public class codeforces {
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }
        public Scanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }
        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
        public String nextLine() throws IOException {
            return br.readLine();
        }
        public boolean ready() throws IOException {
            return br.ready();
        }
    }
    public static void main(String[] args) throws IOException {
        Scanner sc  =new Scanner(System.in);PrintWriter pw=new PrintWriter(System.out);
        int n=sc.nextInt();
        if (n%4==0){
            System.out.println(0);System.out.print(n/2+" ");
            for (int i=0;i<n/4;i++) System.out.print(4*(i+1)+" "+(1+4*i)+" ");
        }
        else if (n%4==3){
            System.out.println(0);
            System.out.print(((n-1)/2)+" "+3+" ");
            for (int i=1;i<=((n-3)/4);i++) System.out.print((4*i)+" "+((4*i)+3)+" ");
        }
        else if (n%2==0){
            System.out.println(1);
            System.out.print((n/2)+" "+1+" ");
            for (int i=1;i<=(n-2)/4;i++) System.out.print(((4*i)-1)+" "+((4*i)+2)+" ");
        }
        else {
            System.out.println(1);
            System.out.print((n-1)/2+" ");
            for (int i=1;i<=(n-1)/4;i++) System.out.print((4*i)+" "+((4*i)-1)+" ");
        }
    }
}