899_C. Dividing the numbers
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.
```python
n = int(input())

if n == 3:
    print(0)
    print(2, 1, 2)
    quit()

start = 1
if n % 2 != 0:
    start = 2

end = n // 2
if end % 2 != 0:
    end -= 1

a = [k for k in range(start, n + 1)]
b = a[::-1]

# print(a)
# print(b)

c = []
d = []
step = True

for k in range(end):
    if step:
        c.append(a[k])
        c.append(b[k])
    else:
        d.append(a[k])
        d.append(b[k])
    step = not step

if start != 1:
    c.insert(0, 1)

if end != n // 2:
    c.append(b[n // 2])
    d.append(a[n // 2])

print(abs(sum(c) - sum(d)))
print(len(c), *c)

# def var(s, c):
#     if c == 0:
#         for k in range(10):
#             s1 = str(s) + str(k)
#             print(s1)
#     else:
#         for k in range(10):
#             s1 = str(s) + str(k)
#             var(s1, c - 1)
#
#
# def var0():
#     for k in range(10):
#         var(k, 3)
#
#
# var0()

```