SP1713 SCALE - Funny scales

Description

Kinh\_Can has a set of precious weights P $ _{1} $ , P $ _{2} $ , ..., P $ _{N} $ in which the mass of the i $ ^{th} $ weight is P $ _{i} $ = 3 $ ^{i-1} $ , and a balance with 2 scales. On a nice day, Kinh\_Can decided to show off his set of precious weights to his friends, and said that he can put them in equilibrium with any weight as long as its mass is not more than the mass of the sum of his weights. At first, his friends didn't believe, but after many trials they realized that Kinh\_Can was right. In addition, while putting a thing whose mass is X on a scale, Kinh\_Can could put right away the weights added on the 2 scales to keep their blance without any trial. With a random weight X (X is a natural number, X ≠ 0). Your task is to put weights on scales in order to keep the 2 scales' balance like Kinh\_Can. The first scale initially weights X, and the second one weights 0.

Input Format

Input has exactly one line consisting 2 numbers, the first is N and the second is X.

Output Format

- If there is no solution, you should write -1 - If there is at least one solution for the problem, you should write exactly 2 lines: - The first line contains some numbers descripting the indices of the weights in the first disc - The second line contains some numbers description the indices of the weights in the second disc - **Note:** One of 2 lines can be blank