This page is still under construction.

Parts of this page are still being built. What you see may change.

Barbells

Time limit2sMemory limit512 MB

Summary
Split the weights 1 through n into three groups of equal total weight, or report that no such split exists.
Level

Medium5 of 10

Topics
Math, Greedy, Implementation, Combinatorics
Solved
No attempts yet

Problem

Vanya, Seryozha and Dima like physical exercise. Above all they like lifting heavy things. The three have been doing weightlifting for a long time and have already collected a set of barbells for training. This set consists of nn barbells with distinct integer weights from 1 to nn.

Not long ago the three found a new gym and decided to move all their barbells there. Since they enjoy lifting them so much, each of them wants to carry as much weight as possible. But the three are very honest, so they decided to split the total weight equally.

Help the athletes divide the set of nn barbells with weights 1,2,…,n1, 2, \ldots, n into three parts of equal weight.

Input

The input file contains a single integer nn (1≤n≤100 0001 \leq n \leq 100\,000), the number of barbells.

Output

For each athlete, output the set of barbells that he has to carry to the new gym. The sets are output as follows. On the first line, output the number of barbells in the set. Then, on the second line, output the weights of the barbells separated by spaces.

If the barbells cannot be split into three sets of equal weight, output <<Impossible>>.

If several solutions exist, you may output any of them.

Examples2

  1. Example 1

    Input
    6
    
    Expected output
    2
    3 4
    2
    5 2
    2
    1 6
    
  2. Example 2

    Input
    3
    
    Expected output
    Impossible